Feature Request: allow scripts to be ignored from list
fiznool opened this issue Β· 8 comments
If you prefer to install npm modules locally, and run them via npm run
, you can install ntl in this way:
npm install --save-dev ntl
Then you can configure in your package.json
:
"scripts": {
"start": "ntl",
...
}
This means you don't need to install ntl
globally, and instead you can run npm start
to bring up the ntl options.
The issue is, ntl
will also display start
as one of the items in the list. It would be nice to ignore this script via a command line flag. For example:
"scripts": {
"start": "ntl --ignore start",
...
}
Or in general, for example, a precommit
script with lint-staged
.
The ntl package.json field could be expanded with a blacklist
array option. In my case, it would be:
"scripts": {
"ntl": "ntl",
"precommit": "lint-staged",
"dev": "..."
},
"ntl": {
"blacklist": ["precommit", "ntl"],
"descriptions": {
"dev": "Launch dev mode"
}
}
π for the blacklist option.
Excluding npm start
isnβt possible because itβs just a personal use case.
I just wonder if this should be another key in the package.json
or if it would make more sense to have an option for that like:
-b, --blacklist Exclude scripts from the list [list]
or:
-e, --exclude Exclude scripts from the list [list]
Example:
ntl --exclude=precommit,ntl
Hej @ruyadorno,
would you accept a PR for that?
sure thing! my thoughts:
- naming-wise I think either
--exclude
or--ignore
are much better options - ideally we should support both
package.json
field AND cli options (but if you want to start with just one that's fine π ) - another improvement I think could be useful is to be able to accept
*
in order to ignore a given prefix/suffix e.g:--ignore=pre*
to ignore all pre-scripts
PR is created
It was our pleasure and we hat lots of fun working together on this π