Hardware Reference
In-Depth Information
Solution
Node Package Manager (npm [
https://www.npmjs.org/
]
) is used to install new packages.
For example, suppose that you are wiring up a GPS (
Recipe 2.8
) and want to use the
nmea
JavaScript package to decode the National Marine Electronics Association (NMEA) data
from the GPS. Install the
nmea
package with the following command:
bone#
npm install -g nmea
npm http GET https://registry.npmjs.org/nmea
npm http 200 https://registry.npmjs.org/nmea
npm http GET https://registry.npmjs.org/nmea/-/nmea-0.0.7.tgz
npm http 200 https://registry.npmjs.org/nmea/-/nmea-0.0.7.tgz
nmea@0.0.7 /usr/local/lib/node_modules/nmea
The
-g
instructs to install globally. That way, you can use
nmea
from any directory. If
-g
is not given, you can use
nmea
only in the directory in which you installed it.