List, fuzzy search and run scripts from any type of project
Easy and fast way to run npm scripts π
- Node.js 18.18.2 or higher
npm i -g @rodbe/nslif you have a permission error, try to install with administrator privileges
nslSelect or search a script to run: <script> [project-path]<script>: Text to match the script name (required)[project-path]: Text to filter by the folder where the script lives (optional)
- Search for a script named
buildthroughout the entire project:
Select or search a script to run: build- Look for a script called
buildinside folders containingapi:
Select or search a script to run: build apinn| Argument | Alias | Description | Comment |
|---|---|---|---|
| --all | -a | list all scripts | by default lifecycle scripts are ignored |
| --info | -i | get all info tech for debugging | |
| --version | -v | get current version | |
| -p | print the selected script | no exec the script, just print it | |
| --update | -u | update to last version | if exists, update to last version |
You can configure NSL via (in order of precedence):
- A
.nslrcfile written in JSON - A
.nslrc.jsonfile - A
.nslrc.jsfile written in ES module that exports an object usingexport default - A
.nslrc.cjsfile written in CommonJS module that exports an object usingmodule.exports
The options you can use in the configuration file.
| Option | Type | Description |
|---|---|---|
| ignoreScripts | string[] | scripts to ignore |
JSON: .nslrc o .nslrc.json file
{
"ignoreScripts": [
"any-script-name-to-ignore",
"other-script-name-to-ignore",
"another-script-name-to-ignore"
]
}JS (ES Modules): .nslrc.js file
export default {
ignoreScripts: [
'any-script-name-to-ignore',
'other-script-name-to-ignore',
'another-script-name-to-ignore',
],
};CJS (CommonJS): .nslrc.cjs file
module.exports = {
ignoreScripts: [
'any-script-name-to-ignore',
'other-script-name-to-ignore',
'another-script-name-to-ignore',
],
};MIT