Using Node.js Packages Manager (NPM)

NPM is a package manager for Node.js packages, or modules; it hosts thousands of free packages to download and use.

To begin with, npm init creates our package.json to manage packages that we are going to install such as lodash, mongo, nodemon, etc. Now, we can install the lodash module and export it whenever the index.js calls Lodash makes JavaScript easier by taking the hassle out of working with arrays, numbers, objects, strings, etc. Lodash’s modular methods are great for iterating arrays, objects, & strings; manipulating & testing value and creating composite functions. We were now able to concatenate first and last to formulate a full name of each user, to finally filter by age greater than 23:Another useful module that can be installed with NPM is Nodemon which monitor for any changes in your source and automatically restart your server.nodemon

Now we can run nodemon on index.js to check the information about the file:

Advertisements

About Julita Inca

Ingeniero de Sistemas UNAC, Magíster en Ciencias de la Computación PUCP, OPW GNOME 2011, Miembro de la GNOME Foundation desde el 2012, Embajadora Fedora Perú desde el 2012, ganadora del scholarship of the Linux Foundation 2012, experiencia como Admin Linux en GMD y Especialista IT en IBM, con certificaciones RHCE, RHCSA, AIX 6.1, AIX 7 Administrator e ITILv3. Experiencia académica en universidades como PUCP, USIL y UNI. HPC researcher, a simple mortal, like you!
This entry was posted in τεχνολογια :: Technology and tagged , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s