Installing Lodash library

If you remember, Lodash provides a few really great utility functions and we'll be taking advantage of a couple of those inside of our update route. Right in the Terminal, I'm going to use npm i with the --save flag to install it; the module name itself is called lodash, and we'll be using the most recent version @4.15.0:

npm i --save lodash@4.17.5

Now, once this is installed, we can require it up top and then we can go ahead and add our route. At the very top of the server.js file we can make a constant; we'll use underscore as the name for the variable that stores the Lodash library, then we'll go ahead and require it, require('lodash'). Now, I've used regular variables instead of constants for my other imports, ...

Get Advanced Node.js Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.