NPX stand for “Node Package Execute“ . Using “npx” a package can be executable without installing the package. it comes with the npm, when you installed npm above 5.2.0 version then automatically npx will installed. It is an npm package runner that can execute any package that you want from the npm registry without even installing that package.
Use of npx
- Packages used by npx are not installed globally so you have to carefree for the pollution for the long term.
- The npx is useful during a single time use package.
- While experiment with a list of packages as you may not know exactly what you need.
- You don’t have permission to install it globally.
- Sometime, you want to have a script command in
package.json
to execute something without installing these packages as project’s dependencies.
example : To create a React application following command can be used.
npx create-react-app your-app-name