Setting up npm to manage our modules

We're going to be using more than just Johnny-Five and Raspi-IO to create our projects, and you want to be able to move your code around via your favorite Git hosting service, perhaps to move it to a new Raspberry Pi, for example. In order to make this as smooth as possible, we're going to make sure that npm knows how to accurately recreate your projects. For this, we want a preprepared package.json file. To do this, navigate into your project folder and tell it to initialize:

cd led-blink
npm init -y
The -y in the npm init command tells npm to use the default answer to all initialization questions. This is fine for projects that only you will use, but if you plan to deploy your work for others to use, or create your own npm modules, be sure to edit your package.json accordingly.

These commands create our package.json so that when we install npm modules with --save, the manifest will update so that when you move your project, there's a complete record of our dependencies.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.59.158.151