Run multiple scripts in a single npm script. Run a simple npm script - npm run echo-hello # Output > echo "Hello" Hello ![]() The output will be - # npm-tips-and-tricks (name of our package) Lifecycle scripts included in npm-tips-and-tricks: test echo "Error: no test specified" & exit 1 start node index.js available via `npm run-script`: echo-hello echo "Hello" echo-helloworld echo "Helloworld" echo-both npm run echo-hello & npm run echo-helloworld echo-both-in-parallel npm run echo-hello & npm run echo-helloworld echo-packagename echo $npm_package_name echo-myvariable echo $npm_package_config_myvariable echo-passargument npm run echo-packagename - "hello" echo-pipedata cat. Now, we can see all commands added above by running this command - npm run npm config set init-author-name "Ankit Jain" npm config set init-author-email " run npm init -y to automatically generate our package - , Let’s configure using npm config command. ![]() We can also set some the default init configuration like the author details etc. There is another way to automatically generate our package.json using the npm init -y command. ![]() We can run npm init command to initialize our package but it will ask information about the package, author, etc. In this article, I will be sharing NPM tips and tricks that can boost your productivity and let you use NPM in a smarter and more efficient way. Any developer who is working with Javascript has used this wonderful CLI tool to install the dependencies for their project. ![]() NPM, Node Package Manager, is the package manager for the JavaScript programming language.
0 Comments
Leave a Reply. |