package-menu-cli
Advanced tools
Comparing version 1.1.2 to 1.2.0
27
cli.js
#!/usr/bin/env node | ||
'use strict'; | ||
const meow = require('meow'); | ||
const packageMenu = require('./src/packageMenu.js'); | ||
const meow = require('meow'); | ||
const execa = require('execa'); | ||
const updateNotifier = require('update-notifier'); | ||
const pkg = require('./package.json'); | ||
const packageMenu = require('./src/packageMenu.js'); | ||
updateNotifier({pkg}).notify(); | ||
const cli = meow(` | ||
@@ -12,5 +17,5 @@ Usage | ||
Options | ||
--help, -h Shows Help (this screen) | ||
--sort, -s Sort Scripts (default: false) | ||
--version, -V Show Package Menu Version | ||
--help, -h Shows Help (this screen) | ||
--sort, -s Sort Scripts (default: false) | ||
--version, -V, -v Show Package Menu Version | ||
@@ -23,6 +28,14 @@ Examples | ||
h: 'help', | ||
V: 'version' | ||
V: 'version', | ||
v: 'version' | ||
} | ||
}); | ||
const menu = packageMenu.print('', cli.flags) | ||
if (cli.flags.update) { | ||
execa('npm i -g package-menu-cli@latest', []).then(result => { | ||
console.log(result.stdout); | ||
}); | ||
} | ||
else { | ||
packageMenu.print('', cli.flags) | ||
} |
{ | ||
"name": "package-menu-cli", | ||
"version": "1.1.2", | ||
"version": "1.2.0", | ||
"description": "Displays menu of scripts from directory containing `package.json`", | ||
@@ -27,3 +27,5 @@ "main": "cli.js", | ||
"cli-table2": "^0.2.0", | ||
"meow": "^3.7.0" | ||
"execa": "^0.5.0", | ||
"meow": "^3.7.0", | ||
"update-notifier": "^1.0.3" | ||
}, | ||
@@ -30,0 +32,0 @@ "devDependencies": { |
@@ -66,3 +66,5 @@ const chalk = require('chalk'); | ||
print: (filename = '', options = {}) => { | ||
console.log(printMenu(filename, options)); | ||
const menu = printMenu(filename, options) | ||
console.log(menu); | ||
return menu; | ||
} | ||
@@ -69,0 +71,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9867
119
5
+ Addedexeca@^0.5.0
+ Addedupdate-notifier@^1.0.3
+ Addedansi-align@1.1.0(transitive)
+ Addedboxen@0.6.0(transitive)
+ Addedcapture-stack-trace@1.0.2(transitive)
+ Addedcli-boxes@1.0.0(transitive)
+ Addedconfigstore@2.1.0(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addedcreate-error-class@3.0.2(transitive)
+ Addedcross-spawn@4.0.2(transitive)
+ Addeddeep-extend@0.6.0(transitive)
+ Addeddot-prop@3.0.0(transitive)
+ Addedduplexer2@0.1.4(transitive)
+ Addedexeca@0.5.1(transitive)
+ Addedfilled-array@1.1.0(transitive)
+ Addedget-stream@2.3.1(transitive)
+ Addedgot@5.7.1(transitive)
+ Addedimurmurhash@0.1.4(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedini@1.3.8(transitive)
+ Addedis-npm@1.0.0(transitive)
+ Addedis-obj@1.0.1(transitive)
+ Addedis-redirect@1.0.0(transitive)
+ Addedis-retry-allowed@1.2.0(transitive)
+ Addedis-stream@1.1.0(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedlatest-version@2.0.0(transitive)
+ Addedlazy-req@1.1.0(transitive)
+ Addedlowercase-keys@1.0.1(transitive)
+ Addedlru-cache@4.1.5(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addednode-status-codes@1.0.0(transitive)
+ Addednpm-run-path@2.0.2(transitive)
+ Addedos-homedir@1.0.2(transitive)
+ Addedos-tmpdir@1.0.2(transitive)
+ Addedosenv@0.1.5(transitive)
+ Addedp-finally@1.0.0(transitive)
+ Addedpackage-json@2.4.0(transitive)
+ Addedpath-key@2.0.1(transitive)
+ Addedprepend-http@1.0.4(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedpseudomap@1.0.2(transitive)
+ Addedrc@1.2.8(transitive)
+ Addedread-all-stream@3.1.0(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedregistry-auth-token@3.4.0(transitive)
+ Addedregistry-url@3.1.0(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsemver-diff@2.1.0(transitive)
+ Addedslide@1.1.6(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedstrip-eof@1.0.0(transitive)
+ Addedstrip-json-comments@2.0.1(transitive)
+ Addedtimed-out@3.1.3(transitive)
+ Addedunzip-response@1.0.2(transitive)
+ Addedupdate-notifier@1.0.3(transitive)
+ Addedurl-parse-lax@1.0.0(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addeduuid@2.0.3(transitive)
+ Addedwhich@1.3.1(transitive)
+ Addedwidest-line@1.0.0(transitive)
+ Addedwrite-file-atomic@1.3.4(transitive)
+ Addedxdg-basedir@2.0.0(transitive)
+ Addedyallist@2.1.2(transitive)