Git Product home page Git Product logo

nps-utils's Introduction

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

nps-utils's People

Contributors

huy-nguyen avatar wmertens avatar vages avatar erikras avatar gunnx avatar mikecann avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.