Node.js

In the closing section of this chapter, we'll turn our attention to writing Lo-Dash code for the backend. This of course means installing Lo-Dash as a Node.js package.

Installing the Lo-Dash package

Assuming you already have Node installed, since you had to do so in order to run the grunt command in the RequireJS examples, you should have an npm command on your system. If that's the case, installation is incredibly easy:

npm install -g lodash

This will install Lo-Dash globally, meaning it's accessible to any other Node project that wishes to use it. This is probably a good idea since Lo-Dash is a library after all. To verify that the installation was a success, you can run the following command:

node -e "require('lodash');"

If you see a ...

Get Lo-Dash Essentials 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.