Coder Social home page Coder Social logo

npm-exec's Introduction

npm-exec

A util for just running a npm script

1. Install

$ npm install --save standalone-npm-exec

2. Usage

const npmExec = require('npm-exec');

npmExec(script, args, pkgdata, wd, function (er) {
  if (er) {
    // Something bad happened
  }
  // Yay!
});

3. API

3.1. npmExec(name, argsForScript, pkgdata, wd, cb)

3.1.1. input

Type: string

The script name to execute. Can either be a script defined in pkgdata or the name of a file in wd/node_modules/.bin.

3.1.2. argsForScript

Type: Array<string>

Any args for the script you are running.

3.1.3. pkgdata

Type: Object

The parsed package.json data for where the script should be executed.

3.1.4. wd

Type: path

The working directory of where to find executables and where to execute the scripts.

3.1.5. cb

Type: function(err)

The function to be called when it is done.

4. CLI

$ npm install --global npm-exec
$ npm-exec --help
Usage
npm-exec [name] [args...]

Arguments
  name: Name of script to run or executable
    If not provided, npm-exec will prompt you to give it a name
  args: Arguments for the script [Default: None]

Examples
  $ npm-exec
  $ npm-exec test
  $ npm-exec eslint *.js

5. License

MIT © legodude17

npm-exec's People

Contributors

legodude17 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

npm-exec's Issues

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.