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: TUTORIAL.md
-157Lines changed: 0 additions & 157 deletions
Original file line number
Diff line number
Diff line change
@@ -2,25 +2,6 @@
2
2
3
3
>The Node Package Manager (NPM) is a command-line tool used by developers to share and control modules (or packages) of JavaScript code written for use with Node.js.
4
4
5
-
```config
6
-
config:
7
-
testRunner:
8
-
command: npm run programmatic-test
9
-
path: coderoad
10
-
actions:
11
-
commits:
12
-
- '55a9b6d'
13
-
- 'd58d630'
14
-
commands:
15
-
- npm install
16
-
repo:
17
-
uri: https://github.com/coderoad/fcc-learn-npm
18
-
branch: v0.3.0
19
-
dependencies:
20
-
- name: node
21
-
version: >=10
22
-
```
23
-
24
5
##Intro
25
6
26
7
>Introduction to the package.json
@@ -49,21 +30,6 @@ One of the most common pieces of information in this file is the `author` field.
49
30
50
31
###Step 1
51
32
52
-
```config
53
-
setup:
54
-
files:
55
-
- package.json
56
-
commits:
57
-
- '5326ec8'
58
-
commands:
59
-
- npm install
60
-
solution:
61
-
files:
62
-
- package.json
63
-
commits:
64
-
- '424cf66'
65
-
```
66
-
67
33
Add your name as the`author` of the project in the package.json file.
68
34
**Note:** Remember that you’re writing JSON, so all field names must use double-quotes (") and be separated with a comma (,).
69
35
@@ -84,19 +50,6 @@ Here's an example:
84
50
85
51
###Step 1
86
52
87
-
```config
88
-
setup:
89
-
files:
90
-
- package.json
91
-
commits:
92
-
- '68ddb97'
93
-
solution:
94
-
files:
95
-
- package.json
96
-
commits:
97
-
- '138ad0e'
98
-
```
99
-
100
53
Add a`description` to the package.json file of your project.
101
54
102
55
**Note:** Remember to use double-quotes for field-names (") and commas (,) to separate fields.
@@ -117,19 +70,6 @@ As you can see, this field is structured as an array of double-quoted strings.
117
70
118
71
###Step 1
119
72
120
-
```config
121
-
setup:
122
-
files:
123
-
- package.json
124
-
commits:
125
-
- '2069439'
126
-
solution:
127
-
files:
128
-
- package.json
129
-
commits:
130
-
- 'f2ed460'
131
-
```
132
-
133
73
Add an array of suitable strings to the`keywords` field in the package.json file of your project.
134
74
135
75
One of the keywords should be "freecodecamp".
@@ -148,19 +88,6 @@ Some common licenses for open source projects include MIT and BSD. License infor
148
88
149
89
###Step 1
150
90
151
-
```config
152
-
setup:
153
-
files:
154
-
- package.json
155
-
commits:
156
-
- 'f2229d1'
157
-
solution:
158
-
files:
159
-
- package.json
160
-
commits:
161
-
- '9378267'
162
-
```
163
-
164
91
Fill the`license` field in the package.json file of your project as you find suitable.
165
92
166
93
##Version
@@ -175,19 +102,6 @@ A `version` is one of the required fields of your package.json file. This field
175
102
176
103
###Step 1
177
104
178
-
```config
179
-
setup:
180
-
files:
181
-
- package.json
182
-
commits:
183
-
- '60a4e7b'
184
-
solution:
185
-
files:
186
-
- package.json
187
-
commits:
188
-
- 'f9f7f29'
189
-
```
190
-
191
105
Add a`version` to the package.json file of your project.
192
106
193
107
##External Packages
@@ -217,22 +131,6 @@ Installed packages are created in a `node_modules` folder in your project. Avoid
217
131
218
132
###Step 1
219
133
220
-
```config
221
-
setup:
222
-
files:
223
-
- package.json
224
-
commits:
225
-
- 'e97c095'
226
-
watchers:
227
-
- package.json
228
-
- node_modules/moment
229
-
solution:
230
-
files:
231
-
- package.json
232
-
commits:
233
-
- '97af83a'
234
-
```
235
-
236
134
Install the "moment" package to the`dependencies` field of your package.json file by running the command line npm install.
237
135
238
136
**Note:** Moment is a handy library for working with time and dates.
@@ -264,22 +162,6 @@ npm install express@4.17.0
264
162
265
163
###Step 1
266
164
267
-
```config
268
-
setup:
269
-
files:
270
-
- package.json
271
-
commits:
272
-
- 'be03933'
273
-
watchers:
274
-
- package.json
275
-
- node_modules/moment
276
-
solution:
277
-
files:
278
-
- package.json
279
-
commits:
280
-
- 'ba77ae7'
281
-
```
282
-
283
165
In the dependencies section of your package.json file, change the`version` of moment to match MAJOR version 2, MINOR version 10 and PATCH version 2
284
166
285
167
##Receive Patch Updates
@@ -296,19 +178,6 @@ To allow an npm dependency to update to the latest PATCH version, you can prefix
296
178
297
179
###Step 1
298
180
299
-
```config
300
-
setup:
301
-
files:
302
-
- package.json
303
-
commits:
304
-
- 'c4ff0f6'
305
-
solution:
306
-
files:
307
-
- package.json
308
-
commits:
309
-
- 'cc1f2a5'
310
-
```
311
-
312
181
In the package.json file, your current rule for how npm may upgrade moment is to use a specific version (2.10.2). But now, you want to allow the latest 2.10.x version.
313
182
Use the tilde (`~`) character to prefix the version of moment in your dependencies, and allow npm to update it to any new PATCH release.
314
183
@@ -330,19 +199,6 @@ This would allow updates to any 1.x.x version of the package.
330
199
331
200
###Step 1
332
201
333
-
```config
334
-
setup:
335
-
files:
336
-
- package.json
337
-
commits:
338
-
- 'fb75ecf'
339
-
solution:
340
-
files:
341
-
- package.json
342
-
commits:
343
-
- 'd0e1a22'
344
-
```
345
-
346
202
Use the caret (`^`) to prefix the version of moment in your dependencies and allow npm to update it to any new MINOR release.
347
203
348
204
**Note:** The version numbers themselves should not be changed.
@@ -359,19 +215,6 @@ This same method applies to removing other fields in your package.json as well.
359
215
360
216
###Step 1
361
217
362
-
```config
363
-
setup:
364
-
files:
365
-
- package.json
366
-
commits:
367
-
- 'da1e99e'
368
-
solution:
369
-
files:
370
-
- package.json
371
-
commits:
372
-
- '796b176'
373
-
```
374
-
375
218
Remove the moment package from your dependencies.
376
219
377
220
**Note:** Make sure you have the right amount of commas after removing it.