Join Alexander Zanfir for an in-depth discussion in this video Managing third-party packages with npm, part of Learning Node.js.
- We covered creating our own modules for Node…but what about third party modules?…Node has something called…a Node Package Manager or npm.…And packages are one on one modules bundled together.…One of the more popular packages is called gulp.…Let's cover how we can get gulp installed…and then how we can make use of it.…Let's go over to our console…and we'll install the package with npm…by typing npm install and then gulp.…And npm at this point will download and install gulp…and if we head back into Brackets…we can see it created a new folder called node_modules.…
Within that we have a gulp folder that has the package.…And just like we did in our own module,…we'll use require to access it.…Let's create a script to use gulp.…Let's create a new file…and we'll call this gulpfile.js.…Before we continue, let's go over…what gulp actually does.…It helps automate repetitive tasks.…So we can create our own custom task…and have gulp run it.…Let's do that now to see how it works.…
The first thing we'll do, just like we did…with our module, is require in gulp…
- Installing Node.js
- Writing modules and packages
- Reading and writing files
- Working with frameworks: Express, Sails, and Koa
- Generating promises
- Working with generator functions
Skill Level Beginner
Q: When I try to install Bluebird/Express/Gulp/Sails/KOA using the Node Package Manager, it seems to install correctly in the terminal. But why doesn't my project folder change?
A: You need to make sure that you've navigated to your project folder in the terminal. For example, in this course Alexander is working from the C:\Dev\ folder both in Brackets and in the terminal.