You can search for packages at npmjs.com
npm -v
to verify everything installed properlynpm init
while in your project directorypackage.json
was created.npm install [package_name]
to install a packagenpm install [package_name] --save-dev
to install a package and save it to your package.jsonnpm install [package_name] -g
to install a package globally.
npm install gulp-cli -g
installs gulp-cli globally and I can use gulp
in the command
line
NPM creates a node_modules folder whenever you run npm install.
Do not include and commit this folder
to github.
npm install gulp-cli -g
npm install gulp --save-dev
var gulp = require('gulp');
//Tasks executes when you type `gulp` in the console
gulp.task('default', function(){
console.log('task');
});
//Tasks executes when you type `gulp css` in the console
gulp.task('css', function(){
console.log('task');
});