npm install aspm> A node CLI script like npm but for Atom-Shell. Install and build npm-modules for Atom-Shell.
aspm is designed as a replacement for npm if you're working on an Atom-Shell project.
Warning: May be unreliable at the moment.
Table of Contents
- Prequisities
- Installation
- Quick-Start
- Usage
- Configuration (optional)
- Overriding configuration
- Without configuration
- Examples
- How it works
- Under the hood
- Support for modules that use node-pre-gyp
- BTW
node & npm(global)node-gyp(global), also fulfill it's requirements.npm install aspm -g.npm install -g aspmaspm in place of npm in your project.
Usage: aspm [options] [command] Commands:
install|i [module] install module (fetch & build)
fetch|f [module] fetch module
build|b build module
Options:
-h, --help output usage information
-V, --version output the version number
-t, --target Atom-Shell version
-a, --arch target architecture
-p, --target-platform target platform
-s, --save save as dependency to package.json
-s, --save-dev save as devDependency to package.json
-g install globally with normal npm
--tarball [url/path] install from [remote] tarball
--quiet don't say anything
`Configuration (optional)
You can (and should to make things more convenient) configure default values for target, arch and platform in your package.json.
`js
{
"config": {
"atom-shell": {
"version": "0.19.5",
"arch": "ia32",
"platform": "win32"
}
}
}
`
This way you can use it just like npm without additional parameters (for basic tasks as shown in usage).$3
You can always set/override some or all configuration values. For example: aspm install --target 0.19.5 --arch ia32.$3
Important: If you don't specify default values, you'll always have to provide at least a target and arch.Examples
Please note that sqlite3 as an example does not work at the moment because of node-pre-gyp.
`
Install all modules from package.json
aspm installInstall specific module and save as dependency in package.json
aspm install sqlite3 --saveInstall specific module in a specific version and save as dependency in package.json
aspm install sqlite3@3.0.4 --saveInstall multiple module and save as dependency in package.json
aspm install sqlite3 async --saveInstall module from tarball
In contrast to npm you have to specify the module name here too.
aspm install sqlite3 --tarball https://github.com/mapbox/node-sqlite3/archive/master.tar.gz --target 0.19.5 --arch ia32Build a specific module for a specific target
aspm build sqlite3 --target 0.19.5 --arch ia32fetch all modules from package.json, then build all in a separate step
aspm fetch
aspm build
`How it works
$3
To fetch the modules we just call out to npm with --ignore-scripts. To build and node-gyp with some additional arguments.$3
We have basic support for compiling modules that use node-pre-gyp (i.e. sqlite3`) by faking some stuff.I haven't looked into these, yet.
- https://github.com/paulcbetts/grunt-build-atom-shell
- https://github.com/atom/atom-shell-starter in scripts/
- https://github.com/probablycorey/atom-node-module-installer