New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

npx

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npx

execute npm package binaries

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
103K
decreased by-8.73%
Maintainers
1
Weekly downloads
 
Created
Source

npm license Travis AppVeyor Coverage Status

npx(1) -- execute npm package binaries

SYNOPSIS

npx [--package|-p <package>] [--cache <path>] [--save-dev|-D] [--save-prod|-P] [--save-optional|-O] [--save-bundle|-B] [--save-exact|-E] [--global|-g] [--prefix|-C] [--userconfig <path>] [-c <string>] [--version|-v] <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.

  • -v, --version - Show the current npx version.

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)

Keywords

FAQs

Package last updated on 30 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc