Skip to content

Commit 77569fa

Browse files
committed
Review NodeJS
1 parent c3cd5fd commit 77569fa

2 files changed

Lines changed: 16 additions & 12 deletions

File tree

docs/user/NodeJS.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,30 @@ Applications can freely import and use NPM packages, including native ones.
55

66
## Running Node.js Applications
77

8-
To run Node.js-based applications, use the `node` binary executable in the GraalVM distribution:
9-
```
8+
To run Node.js-based applications, use the `node` launcher in the GraalVM distribution:
9+
```shell
1010
$GRAALVM_HOME/bin/node [options] [filename] [args]
1111
```
1212

13-
GraalVM's Node.js is based on a recent version of Node.js, and runs the GraalVM JavaScript engine instead of Google V8. Thus, some internal features (e.g., VM-internal statistics or configuration, profiling, debugging, etc.) are unsupported, or supported with potentially different behavior.
13+
GraalVM's Node.js runtime is based on a recent version of Node.js, and runs the
14+
GraalVM JavaScript engine instead of Google V8. Thus, some internal features (e.g.,
15+
VM-internal statistics, configuration, profiling, debugging, etc.) are
16+
unsupported, or supported with potentially different behavior.
1417

15-
The `node` executable is largely compatible with Node.js, and features additional GraalVM-specific functionalities (e.g., interoperability with Java and all other GraalVM languages).
18+
The `node` command is largely compatible with Node.js, and features additional GraalVM-specific functionalities (e.g., interoperability with Java and all other GraalVM languages).
1619
A list of available options can be obtained with `node --help`.
1720

1821
## Installing Packages Using `npm`
1922

20-
To install a Node.js package, you can use the `npm` executable in the `$GRAALVM_HOME/bin` folder of GraalVM.
21-
The `npm` executable is equivalent to the default NPM command, and supports most of its options.
23+
To install a Node.js package, you can use the `npm` launcher from the GraalVM's `/bin` folder.
24+
The `npm` command is equivalent to the default NPM command, and supports most of its options.
2225

2326
An NPM package can be installed with:
24-
```
27+
```shell
2528
$GRAALVM_HOME/bin/npm install <package>
2629
```
27-
As the `npm` executable of GraalVM is largely compatible with NPM, packages will be installed in the `node_modules` folder, as expected.
30+
31+
As the `npm` command of GraalVM is largely compatible with NPM, packages will be installed in the `node_modules` folder, as expected.
2832

2933
### Installing `npm` Packages Globally
3034

@@ -33,7 +37,7 @@ By default, `npm` installs global packages in the path where the `node` executab
3337
In GraalVM, this means that global packages will create files in the GraalVM folder.
3438
To avoid writing to the GraalVM folder, the default global installation folder of `npm` can be modified by setting the `$PREFIX` environment variable, or by specifying the `--prefix` option when running `npm install`.
3539
For example, the following command will install global packages in the `/foo/bar` folder:
36-
```
40+
```shell
3741
$GRAALVM_HOME/bin/npm install --prefix /foo/bar -g <package>
3842
```
39-
More details about `prefix` can be found in the official npm documentation.
43+
More details about `prefix` can be found in the [official NPM documentation](https://docs.npmjs.com/cli/prefix.html).

docs/user/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ engines, migration guides are available.
1212

1313
## Running JavaScript
1414

15-
GraalVM can execute plain JavaScript code:
15+
GraalVM can run plain JavaScript code:
1616
```shell
1717
js [options] [filename...] -- [args]
1818
```
@@ -26,7 +26,7 @@ To run Node.js-based applications, use the `node` utility bundled with GraalVM b
2626
node [options] [filename] [args]
2727
```
2828

29-
To install a Node.js module, use the `npm` executable from the GraalVM's `/bin` folder. The `npm` command is equivalent to the default Node.js command and supports all Node.js APIs.
29+
To install a Node.js module, use the `npm` launcher from the GraalVM's `/bin` folder. The `npm` executable is equivalent to the default Node.js command and supports all Node.js APIs.
3030

3131
1&#46; Install the `colors` and `ansispan` modules using `npm install` as
3232
follows:

0 commit comments

Comments
 (0)