nps-utils
Utilities for npsnps (npm-package-scripts)!Build Statusbuild-badgebuild !Code Coveragecoverage-badgecoverage !Dependenciesdependencyci-badgedependencyci !versionversion-badgepackage !downloadsdownloads-badgenpm-stat !MIT Licenselicense-badgeLICENSE
!Watch on GitHubgithub-watch-badgegithub-watch !Star on GitHubgithub-star-badgegithub-star !Tweettwitter-badgetwitter
The problem
npsnps is a great package to empower your scripts and there are some common things you wind up doing to keep yourpackage-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 usingnps
.Check out what the
concurrent
and runInNewWindow
methods can do:
Installation
This module is distributed via npmnpm which is bundled with nodenode and should be installed as one of your project'sdevDependencies
:npm install --save-dev nps-utils
Usage
You'll most likely use this in yourpackage-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 herenps
also exports common-tags
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 keyemojis):|
Kent C. Dodds
💻 📖 🚇 ⚠️ |
Huy Nguyen
📖 🚇 |
Keith Gunn
🐛 💻 📖 ⚠️ |
Mike Cann
💻 ⚠️ | | :---: | :---: | :---: | :---: |
This project follows the all-contributorsall-contributors specification. Contributions of any kind welcome!