-
Notifications
You must be signed in to change notification settings - Fork 399
Expand file tree
/
Copy pathnpm.rb
More file actions
150 lines (143 loc) · 3.7 KB
/
npm.rb
File metadata and controls
150 lines (143 loc) · 3.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
cheatsheet do
title 'npm'
docset_file_name 'npm'
keyword 'npm'
source_url 'http://cheat.kapeli.com'
category do
id 'Getting Started'
entry do
notes '
```
npm ls
```'
name 'List everything you have installed in the current directory'
end
entry do
notes '
```
npm search [search terms]
```'
name 'Search the registry for packages matching terms'
end
entry do
name 'Install a package'
notes <<-'END'
```shell
npm install [<name> [<name> ...]] [--save|--save-dev|--save-optional]
```
This command installs a package, or packages, and any packages that
it depends on in the current directory. If the package has a shrinkwrap
file, the installation of dependencies will be driven by that.
If no `package.json` exists, these options are ignored. If it exists, they'll
update them if they are already there.
* `--save`: Package will appear in your depedencies.
* `--save-dev`: Package will appear in your devDependencies.
* `--save-optional`: Package will appear in your optionalDependencies.
* `--global`: Package will be installed globally (if you want to use it as a command line tool for example)
END
end
entry do
notes '
```
npm install <module-name>@<version-name>
```'
name 'Install a package in the version'
end
entry do
notes '
```
npm uninstall
```'
name 'Uninstall a package, completely removing everything npm installed on its behalf'
end
entry do
notes '
```
npm update [<name> [<name> ...]]
```'
name 'Update all the packages listed to the latest version (specified by the tag config). Also install missing packages'
end
entry do
notes '
```
npm update npm -g
```'
name 'Update the global npm version'
end
entry do
notes '
```
npm docs <module-name>
```'
name 'Display the README.md / documentation / npmjs.org page of a give library'
end
entry do
notes '
```
npm test
```'
name 'Run package test suite, based on setup in package.json in'
notes <<-END
```json
"scripts" : {"test" : "node testfile.js"}
```
END
end
entry do
notes '
```
npm outdated
```'
name 'List outdated libraries compared to currently installed node_modules'
end
entry do
notes '
```
npm shrinkwrap
```'
name 'Lock down dependency versions'
end
end
category do
id 'Develop'
entry do
name 'Interactively create a package.json file'
notes '
```
npm init
```
Asks you a bunch of questions, and then writes a package.json for you. If you already have a package.json file, it\'ll read that first, and default to the options in there.'
end
entry do
notes '
```
npm install git://github.com/Marak/colors.js#v0.6.0
```'
name 'Install a git specific release'
end
entry do
notes '
```
npm edit <module_name>
```'
name 'Locally edit a dependency'
end
entry do
notes '
```
npm config set editor "sublime"
```'
name 'Setup editor for npm edit'
end
entry do
notes '
```
npm publish --tag beta
```'
name 'Publish a package not under the default "latest" tag'
end
end
end
# Created by <cam song><neosoyn@gmail.com>
# Thanks to https://gist.github.com/AvnerCohen/4051934
# http://jessewarden.com/archives/node-bower-grunt-cheat-sheet-v1-jessewarden.com.pdf