Gary Katsevman
🏛 Brightcove / video.js
🐙 @gkatsev
🐦 @gkatsev
$ npm install --global npm@latest
$ npm i -g npm@latest-2
$ npm i -g grunt-cli
$ npm install --global grunt-cli
$ npm i grunt-cli
$ ./node_modules/.bin/grunt
$ $(npm bin)/grunt
$ cat package.json
{
"name": "test",
"version": "1.0.0",
"scripts": {
"grunt": "grunt",
"test": "grunt test"
}
}
$ npm run grunt
$ npm run grunt -- test
$ npm install --save global
$ npm i -S global
$ cat package.json
{
...
"dependencies": {
"global": "^4.3.0"
}
...
}
$ npm install --save --save-exact global
$ npm install -S -E global
$ cat package.json
{
...
"dependencies": {
"global": "4.3.0"
}
...
}
$ npm install --save-dev grunt-cli grunt
$ npm i -D grunt-cli grunt # grunt-cli is installed into $(npm bin) automatically now with RC1
$ cat package.json
{
...
"devDependencies": {
...
"grunt": "^0.4.4",
"grunt-cli": ""^0.1.13",
...
}
...
}
$ npm help 7 config
NAME
npm-config - More than you probably want
to know about npm configuration
$ npm version major|minor|patch
$ npm version premajor|preminor|prepatch|prerelease
$ npm version patch
new version is 1.0.1
$ npm version minor
new version is 1.1.0
$ npm major
new version is 2.0.0
$ npm version premajor
new version is 3.0.0-0
$ npm version major
new version is 3.0.0
$ cat package.json
{
...
"scripts": {
"prebuild": "mkdirp dist/",
"build": "browserify . -o dist/bundle.js",
"pretest": "npm run lint",
"test": "node tests/**/*.js",
"lint": "vjsstandard",
"start": "npm-run-all -p test build",
...
}
...
}
$ npm run test
running `pretest`:
vjsstandard
running `test`:
node tests/**/*.js
.
.
.
$ cat package.json
{
...
"scripts": {
"version": "npm run build && git add ."
...
}
...
}
$ cat package.json
{
...
"scripts": {
"version": "chg release && git add CHANGELOG.md"
...
}
...
}
$ cat package.json
{
...
"scripts": {
"build": "browserify . -o dist/bundle.js",
"prepublish": "npm-run-all -s test build"
...
}
...
}
$ cat package.json
{
...
"scripts": {
"build": "browserify . -o dist/bundle.js",
"prepublish": "not-in-install && npm-run-all -s test build || in-install"
...
},
"devDepdenencies": {
"in-publish": "^2.0.0",
...
},
...
}