JSPM

  • Created
  • Published
  • Downloads 153629
  • Score
    100M100P100Q35853F
  • License CC0-1.0

execute npm package binaries

Package Exports

  • npx

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (npx) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

npm license Travis AppVeyor Coverage Status

npx(1) -- execute npm package binaries

SYNOPSIS

npx [--package|-p <package>] [--cache <path>] [--install-dev|-D] [--install-prod|-P] [--userconfig <path>] [-c <string>] <command>[@version] -- [command-arg]...

INSTALL

npm install -g npx

DESCRIPTION

Executes <command> either from a local node_modules/.bin, or from a central cache, installing any packages needed in order for <command> to run.

By default, <command> will be installed prior to execution. An optional @version may be appended to specify the package version required.

  • -p, --package <package> - define the package to be installed. This defaults to the value of <command>. This is only needed for packages with multiple binaries if you want to call one of the other executables, or where the binary name does not match the package name. If this option is provided <command> will be executed as-is, without interpreting @version if it's there.

  • --cache <path> - set the location of the npm cache. Defaults to npm's own cache settings.

  • -g, --global - install the package globally before execution.

  • -D, --save-dev, -P, --save-prod, -O, --save-optional, -B, --save-bundle, -E, --save-exact - install the package in the current npm project and save it to package.json following the same option conventions for this as npm install would.

  • -C, --prefix - The location to install global items. If used without -g, will force any installs to run in the specified folder. Defaults to whatever npm's default is.

  • --userconfig - path to the user configuration file to pass to npm. Defaults to whatever npm's current default is.

  • -c <string> - Execute <string> with delayed environment variable evaluation.

EXAMPLES

Running a project-local bin

$ npm i -D webpack
$ npx webpack -- ...

One-off invocation without local installation

$ npm rm webpack
$ npx webpack -- ...
$ cat package.json
...webpack not in "devDependencies"...

Execute binary and add it to package.json as a devDependency

$ npx -D webpack -- ...
$ cat package.json
...webpack added to "devDependencies"

ACKNOWLEDGEMENTS

Huge thanks to Kwyn Meagher for generously donating the package name in the main npm registry. Previously npx was used for a Tessel board Neopixels library, which can now be found under npx-tessel.

AUTHOR

Written by Kat Marchan.

REPORTING BUGS

Please file any relevant issues on Github.

LICENSE

This work is released by its authors into the public domain under CC0-1.0. See LICENSE.md for details.

SEE ALSO

  • npm(1)
  • npm-run-script(1)
  • npm-config(7)