### package.json
: '
{
"name": "angular-seed",
"private": true,
"version": "0.0.0",
"description": "A starter project for AngularJS",
"repository": "https://github.com/angular/angular-seed",
"license": "MIT",
"devDependencies": {
},
"scripts": {
"custom-node": "./bin/custom-node-script.js"
}
}
'
### custom-node-script.js
#! /usr/bin/env node
console.log("Arguments passed to custom-node-script:");
process.argv.forEach(function (val, index, array) {
console.log(index + ': ' + val);
});
### Execute NPM Script from terminal
npm run custom-node --- 1 2 3 --test abc
: ' Output:
Arguments passed to custom-node-script:
0: /usr/local/bin/node
1: /Users/username/project-name/bin/node-script.js
2: 1
3: 2
4: 3
5: --test
6: abc
'
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.