You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lectures/NPM.md
+43-4Lines changed: 43 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,12 +29,51 @@ The most commonly used npm commands are:
29
29
* docs <packagename> (to open the doc's page for a package)
30
30
* link <location> (to link to a package locally during development)
31
31
32
-
# npm install
32
+
###npm install
33
33
34
34
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.
35
35
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.
0 commit comments