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: docs/2-Presets/NodeJS.md
+15-8Lines changed: 15 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,11 +32,15 @@ After installing Node.js, `kool create` automatically runs the `kool preset node
32
32
```bash
33
33
$ Preset nodejs is initializing!
34
34
35
-
? Which javascript package manager do you want to use [Use arrows to move, type to filter]
35
+
? Which Javascript package manager do you want to use [Use arrows to move, type to filter]
36
36
> npm
37
37
yarn
38
+
None
38
39
39
-
$ Preset nodejs initialized!
40
+
...
41
+
...
42
+
43
+
Preset nodejs created successfully!
40
44
```
41
45
42
46
Now, move into your new Node.js project:
@@ -65,18 +69,21 @@ To help get you started, **kool.yml** comes prebuilt with an initial set of scri
65
69
```yaml
66
70
scripts:
67
71
node: kool exec app node
68
-
npm: kool exec app npm # or yarn
69
-
npx: kool exec app npx
70
-
72
+
#npm - helpers for JS handling
73
+
npm: kool docker kooldev/node:20 npm
74
+
npx: kool docker kooldev/node:20 npx
71
75
setup:
72
-
- kool start
73
-
# - add more setup commands
76
+
- kool run npm install
77
+
reset:
78
+
- kool run npm install
74
79
```
75
80
76
-
Go ahead and run `kool run setup` to start your Docker environment and finish setting up your project:
81
+
Go ahead and run `kool run setup` to finish setting up your project and then `kool start` to start running the container:
77
82
78
83
```bash
79
84
$ kool run setup
85
+
86
+
$ kool start
80
87
```
81
88
82
89
> As you can see in **kool.yml**, the `setup` script will do the following in sequence: run the `kool start` command to spin up your Docker environment using **docker-compose.yml** (which includes a `command` to automatically run `node app.js`); and then run any additional commands you add to the list.
0 commit comments