Learning Node.js Development
上QQ阅读APP看书,第一时间看更新

Installing the lodash module in our app

To install a module in the app, we will run a command over in the Terminal. In this chapter, we'll be installing a module called lodash. The lodash module comes with a ton of utility methods and functions that make developing inside Node or JavaScript a heck of a lot easier. To take a look at what exactly we're getting into, let's move into the browser.

We'll to go to https://www.npmjs.com. Then we'll search for the package, lodash, and you can see it comes up, as shown in the following screenshot:

When you click on it, you should be taken to the package page, and the package page will show you a lot of statistics about the module and the documentation, as shown here:

Now, I use the lodash package page when I'm looking for new modules; I like to see how many downloads it has and when it was last updated. On the package page, you can see it was updated recently, which is great it means the package is most likely compatible with the latest versions of Node, and if you go further down the page, you can see this is actually one of the most popular npm packages, with over a million downloads a day. We will be using this module to explore how to install npm modules and how to actually use them in a project.