UNPKG

4.77 kBMarkdownView Raw
1# aspm - Atom-Shell package manager
2[![build status](http://img.shields.io/travis/bwin/master/aspm.svg?style=flat-square)](https://travis-ci.org/bwin/aspm)
3[![dependencies](http://img.shields.io/david/bwin/aspm.svg?style=flat-square)](https://david-dm.org/bwin/aspm)
4[![npm version](http://img.shields.io/npm/v/aspm.svg?style=flat-square)](https://npmjs.org/package/aspm)
5
6> A node CLI script like npm but for Atom-Shell. Install and build npm-modules for Atom-Shell.
7
8`aspm` is designed as a replacement for `npm` if you're working on an Atom-Shell project.
9
10**Warning:** *May be unreliable at the moment.*
11
12**Table of Contents**
13- [Prequisities](#prequisities)
14- [Installation](#installation)
15- [Quick-Start](#quick-start)
16- [Usage](#usage)
17- [Configuration (optional)](#configuration-optional)
18 - [Overriding configuration](#overriding-configuration)
19 - [Without configuration](#without-configuration)
20- [Examples](#examples)
21- [How it works](#how-it-works)
22 - [Under the hood](#under-the-hood)
23 - [Support for modules that use `node-pre-gyp`](#support-for-modules-that-use-node-pre-gyp)
24- [BTW](#btw)
25
26## Prequisities
27Since you're using Atom-Shell you most likely have those installed already.
28- `node` & `npm`(global)
29- `node-gyp`(global), also fulfill it's [requirements](https://github.com/TooTallNate/node-gyp#installation).
30
31## Installation
32Install (preferred globally) with `npm install aspm -g`.
33
34## Quick-Start
35- Install globally with npm. `npm install -g aspm`
36- Add some configuration to your package.json. (See Configuration. This is optional but highly recommended.)
37- Now use `aspm` in place of `npm` in your project.
38
39## Usage
40```
41 Usage: aspm [options] [command]
42
43 Commands:
44
45 install|i [module] install module (fetch & build)
46 fetch|f [module] fetch module
47 build|b <module> build module
48
49 Options:
50
51 -h, --help output usage information
52 -V, --version output the version number
53 -t, --target <version> Atom-Shell version
54 -a, --arch <arch> target architecture
55 -p, --target-platform <platform> target platform
56 -s, --save save as dependency to package.json
57 -s, --save-dev save as devDependency to package.json
58 -g install globally with normal npm
59 --tarball [url/path] install from [remote] tarball
60 --quiet don't say anything
61```
62
63## Configuration (optional)
64You can (and should to make things more convenient) configure default values for target, arch and platform in your `package.json`.
65```js
66{
67 "config": {
68 "atom-shell": {
69 "version": "0.19.5",
70 "arch": "ia32",
71 "platform": "win32"
72 }
73 }
74}
75```
76This way you can use it just like npm without additional parameters (for basic tasks as shown in usage).
77
78### Overriding configuration
79You can always set/override some or all configuration values. For example: `aspm install --target 0.19.5 --arch ia32`.
80
81### Without configuration
82**Important:** If you don't specify default values, you'll always have to provide at least a target and arch.
83
84## Examples
85Please note that `sqlite3` as an example does not work at the moment because of `node-pre-gyp`.
86```
87# Install all modules from package.json
88aspm install
89
90# Install specific module and save as dependency in package.json
91aspm install sqlite3 --save
92
93# Install specific module in a specific version and save as dependency in package.json
94aspm install sqlite3@3.0.4 --save
95
96# Install multiple module and save as dependency in package.json
97aspm install sqlite3 async --save
98
99# Install module from tarball
100# In contrast to npm you have to specify the module name here too.
101aspm install sqlite3 --tarball https://github.com/mapbox/node-sqlite3/archive/master.tar.gz --target 0.19.5 --arch ia32
102
103# Build a specific module for a specific target
104aspm build sqlite3 --target 0.19.5 --arch ia32
105
106# fetch all modules from package.json, then build all in a separate step
107aspm fetch
108aspm build
109```
110
111## How it works
112
113### Under the hood
114To fetch the modules we just call out to `npm` with `--ignore-scripts`. To build and `node-gyp` with some additional arguments.
115
116### Support for modules that use `node-pre-gyp`
117We have basic support for compiling modules that use `node-pre-gyp` (i.e. `sqlite3`) by faking some stuff.
118
119## BTW
120There may or may not be several (maybe better?) alternatives to this.
121- https://github.com/atom/atom-shell/blob/master/docs/tutorial/using-native-node-modules.md
122
123I haven't looked into these, yet.
124- https://github.com/paulcbetts/grunt-build-atom-shell
125- https://github.com/atom/atom-shell-starter in scripts/
126- https://github.com/probablycorey/atom-node-module-installer
\No newline at end of file