package-menu-cli
Advanced tools
Comparing version 1.4.4 to 1.5.1
@@ -8,17 +8,22 @@ ## package-menu-cli Changelog | ||
- 14.2: Issues | ||
- Added terminal width check [#005](https://github.com/mikeerickson/pkg-menu-cli/issues/5) | ||
- 1.5.0: changes | ||
- Replaced `cli-table2` with `cli-table3` | ||
- `cli-table2` is not longer maintained | ||
- | ||
- 1.4.2: Issues | ||
- Added terminal width check [#005](https://github.com/mikeerickson/pkg-menu-cli/issues/5) | ||
- 1.4.0: Added `launch` interface | ||
- Further cli options will be passed to `launcher` | ||
- `$ package-menu -l -a | -m | -i` | ||
` --all, -a run all scripts` | ||
` --info, -i shows package description` | ||
` --multiple, -m allow multiple selection` | ||
- Further cli options will be passed to `launcher` | ||
- `$ package-menu -l -a | -m | -i` | ||
` --all, -a run all scripts` | ||
` --info, -i shows package description` | ||
` --multiple, -m allow multiple selection` | ||
- 1.3.0: Added `compress` switch | ||
- `$ package-menu --compress` | ||
- `$ package-menu -c` | ||
- `$ package-menu --compress` | ||
- `$ package-menu -c` | ||
- 1.1.1: Minor tweaks | ||
- Removed fixed column width for 'script' column | ||
- Removed fixed column width for 'script' column | ||
@@ -33,4 +38,2 @@ - 1.1.0: Internal refactoring for better testing | ||
## Credits | ||
@@ -37,0 +40,0 @@ |
34
cli.js
@@ -8,17 +8,17 @@ #!/usr/bin/env node | ||
// load all modules we will be using | ||
const meow = require('meow'); | ||
const meow = require('meow'); | ||
const updateNotifier = require('update-notifier'); | ||
const latestVersion = require('latest-version'); | ||
const compare = require('semver-compare'); | ||
const execa = require('execa'); | ||
const latestVersion = require('latest-version'); | ||
const compare = require('semver-compare'); | ||
const execa = require('execa'); | ||
// load package class | ||
const pkg = require('./package.json'); | ||
const packageMenu = require('./src/packageMenu.js'); | ||
const ntlMenu = require('./src/ntlMenu.js'); | ||
const pkg = require('./package.json'); | ||
const packageMenu = require('./src/packageMenu.js'); | ||
const ntlMenu = require('./src/ntlMenu.js'); | ||
// see if we have a newer version of cli | ||
latestVersion(pkg.name).then(version => { | ||
const notifier = updateNotifier({pkg}); | ||
notifier.update = {latest: version, current: pkg.version} | ||
const notifier = updateNotifier({ pkg }); | ||
notifier.update = { latest: version, current: pkg.version } | ||
if (compare(pkg.version, version) === -1) { | ||
@@ -50,12 +50,12 @@ notifier.notify(); | ||
alias: { | ||
s: 'sort', | ||
c: 'compress', | ||
h: 'help', | ||
V: 'version', | ||
v: 'version', | ||
l: 'launch' | ||
s: 'sort', | ||
c: 'compress', | ||
h: 'help', | ||
V: 'version', | ||
v: 'version', | ||
l: 'launch' | ||
} | ||
}); | ||
}); | ||
if ((cli.flags.launch) || (cli.flags.l)){ | ||
if ((cli.flags.launch) || (cli.flags.l)) { | ||
ntlMenu.execute(); | ||
@@ -62,0 +62,0 @@ } |
{ | ||
"name": "package-menu-cli", | ||
"version": "1.4.4", | ||
"version": "1.5.1", | ||
"description": "Displays menu of scripts from directory containing `package.json`", | ||
@@ -26,8 +26,8 @@ "main": "cli.js", | ||
"chalk": "^1.1.3", | ||
"cli-table2": "^0.2.0", | ||
"cli-table3": "0.5.1", | ||
"execa": "0.6.0", | ||
"meow": "^3.7.0", | ||
"ntl": "1.1.3", | ||
"semver-compare": "^1.0.0", | ||
"update-notifier": "^1.0.3", | ||
"ntl": "1.1.3" | ||
"update-notifier": "^1.0.3" | ||
}, | ||
@@ -34,0 +34,0 @@ "devDependencies": { |
@@ -13,2 +13,3 @@ # pkg-menu-cli | ||
[Package Menu CLI on npm](https://www.npmjs.com/package/package-menu-cli) | ||
## Usage | ||
@@ -15,0 +16,0 @@ |
let ntlMenu = { | ||
execute: function (args) { | ||
const ntl = require('../node_modules/ntl/cli.js'); | ||
} | ||
execute: function (args) { | ||
const ntl = require('../node_modules/ntl/cli.js'); | ||
} | ||
}; | ||
module.exports = ntlMenu; |
/*global require*/ | ||
const chalk = require('chalk') | ||
const Table = require('cli-table2') // INFO: https://www.npmjs.com/package/cli-table2 | ||
const fs = require('fs') | ||
const Table = require('cli-table3') | ||
const fs = require('fs') | ||
@@ -12,3 +12,3 @@ function buildMenu(pkgInfo = {}, opts = {}) { | ||
if (!pkgInfo.hasOwnProperty('scripts')) { | ||
return {error: true, message: 'package.json does not contain any scripts'} | ||
return { error: true, message: 'package.json does not contain any scripts' } | ||
} | ||
@@ -29,3 +29,3 @@ | ||
const scripts = pkgInfo.scripts | ||
const scripts = pkgInfo.scripts | ||
const scriptNames = Object.keys(scripts) | ||
@@ -32,0 +32,0 @@ |
Sorry, the diff of this file is not supported yet
62
14295
11
+ Addedcli-table3@0.5.1
+ Addedansi-regex@3.0.1(transitive)
+ Addedcli-table3@0.5.1(transitive)
+ Addedis-fullwidth-code-point@2.0.0(transitive)
+ Addedstring-width@2.1.1(transitive)
+ Addedstrip-ansi@4.0.0(transitive)
- Removedcli-table2@^0.2.0
- Removedcli-table2@0.2.0(transitive)
- Removedlodash@3.10.1(transitive)