archpm:
Install npm dependencies based on the OS CPU architecture.
Getting Started
Install the module with: npm install npm-arch-dependencies
.
package.json
Specify your dependencies inside List the specific dependencies for each platform in your package.json
, in the form of os.arch() + 'Dependencies'
.
To include raspi-io
and johnny-five
in arm
only:
"armDependencies":
Then run:
archpm
If you are running the command on a Raspbery Pi archpm
will install raspi-io
and johnny-five
.
npm install
Add archpm
to the scripts section of package.json
Code
In your source code, make sure you are as well importing code based on your architecture.
For example:
const arch = ; { ifarch === 'arm' const five = ; thisrelay = config; else thisrelay = {} {} ; }
Inspiration
Based on the work of bertofer.
License
Copyright (c) 2016 goliatone
Licensed under the MIT license.