JavaScript
Clone or download
Permalink
Failed to load latest commit information.
other docs(maintaining): add maintaining.md Oct 3, 2017
src feat: export shellEscape (#26) Jun 16, 2018
.all-contributorsrc feat(importPackage): added the `importPackage` function (#23) Oct 25, 2017
.babelrc
.doclets.yml tech(dockets): remove package.json Mar 3, 2017
.eslintignore feat(init): initial commit Mar 2, 2017
.gitattributes feat(init): initial commit Mar 2, 2017
.gitignore feat(importPackage): added the `importPackage` function (#23) Oct 25, 2017
.npmrc feat(init): initial commit Mar 2, 2017
.travis.yml feat(init): initial commit Mar 2, 2017
CHANGELOG.md docs: make "releases" page link absolute (#27) Jun 26, 2018
CONTRIBUTING.md feat(init): initial commit Mar 2, 2017
LICENSE feat(init): initial commit Mar 2, 2017
README.md feat(importPackage): added the `importPackage` function (#23) Oct 25, 2017
esdoc.json chore: Add ESDoc and its configuration (#15) Apr 29, 2017
package-scripts.js feat(open): add `open` which uses `opn-cli` Mar 2, 2017
package.json feat(ncp): add `ncp` which uses `ncp` (#21) Oct 3, 2017
yarn.lock feat(ncp): add `ncp` which uses `ncp` (#21) Oct 3, 2017

README.md

nps-utils

Utilities for nps (npm-package-scripts)

Build Status Code Coverage Dependencies version downloads MIT License

All Contributors PRs Welcome Donate Code of Conduct Roadmap Examples

Watch on GitHub Star on GitHub Tweet

Sponsor

The problem

nps is a great package to empower your scripts and there are some common things you wind up doing to keep your package-scripts.js file clean, useful, and maintainable. So you wind up duplicating utility functions across projects.

This solution

This has several utility functions you'll often want when using nps.

Check out what the concurrent and runInNewWindow methods can do:

concurrent gif

Installation

This module is distributed via npm which is bundled with node and should be installed as one of your project's devDependencies:

npm install --save-dev nps-utils

Usage

You'll most likely use this in your package-scripts.js file:

const npsUtils = require('nps-utils')

module.exports = {
  scripts: {
    validate: npsUtils.concurrent.nps('lint', 'build', 'test --coverage'),
    lint: 'eslint .',
    build: 'webpack --env.production',
    test: 'jest'
  }
}

Available methods:

API docs can be found here

nps also exports common-tags as commonTags which can be really helpful for long scripts or descriptions.

Or, see the JSDoc right in the source code 😎

Inspiration

This package was inspired by the removal of --parallel from p-s here.

Other Solutions

I am unaware of other solutions, but if you come across any, please add a PR to list them here!

Contributors

Thanks goes to these people (emoji key):


Kent C. Dodds

πŸ’» πŸ“– πŸš‡ ⚠️

Huy Nguyen

πŸ“– πŸš‡

Keith Gunn

πŸ› πŸ’» πŸ“– ⚠️

Mike Cann

πŸ’» ⚠️

This project follows the all-contributors specification. Contributions of any kind welcome!

LICENSE

MIT