Skip to content

Commit 24e49fe

Browse files
committed
Updated information about NPM
1 parent 53ebedc commit 24e49fe

2 files changed

Lines changed: 48 additions & 4 deletions

File tree

labs/NPM.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
# NPM (Node Package Manager)
22

3+
## Installing a package directly from a git repo
4+
5+
```npm install http://github.com/joeandaverde/leetspeak.git```
6+
7+
This will copy the contents of the git repo to your ```node_modules``` folder.

lectures/NPM.md

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,51 @@ The most commonly used npm commands are:
2929
* docs <package name> (to open the doc's page for a package)
3030
* link <location> (to link to a package locally during development)
3131

32-
# npm install
32+
### npm install
3333

3434
One of the sweetest things about NPM is that you can install from a variety of locations. Most commonly, however, packages are installed from the npmjs.org repository.
3535

36-
## Installing a package directly from a git repo
36+
## What is an NPM package?
37+
38+
a) a folder containing a program described by a package.json file
39+
40+
b) a gzipped tarball containing (a)
41+
42+
c) a url that resolves to (b)
43+
44+
d) a <name>@<version> that is
45+
published on the registry with (c)
46+
47+
e) a <name>@<tag> that points to (d)
48+
49+
f) a <name> that has a "latest" tag satisfying (e)
50+
51+
g) a git url that, when cloned, results in (a).
52+
53+
### Package.json
54+
55+
* Name
56+
* Version
57+
* Engines
58+
* Scripts
59+
* Author
60+
* Main
61+
* Directories
62+
63+
### .npmignore
64+
65+
Allows you to keep out unwanted directories or files from being published to NPM. If this file does not exist NPM will abide by .gitignore if it is present. The .npmignore file will completely override the .gitignore.
66+
67+
## Publishing a package
68+
69+
```npm adduser```
70+
71+
```npm publish```
72+
73+
Keep in mind that everything in your package directory will be published unless it's in the .gitignore or .npmignore files.
74+
75+
76+
77+
3778

38-
```npm install http://github.com/joeandaverde/leetspeak.git```
3979

40-
This will copy the contents of the git repo to your ```node_modules``` folder.

0 commit comments

Comments
 (0)