Skip to content

Commit 922c53e

Browse files
committed
doc: add builtin module in building.md
Fixes: nodejs#12516 Refs: nodejs#2497
1 parent 604578f commit 922c53e

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

BUILDING.md

+23
Original file line numberDiff line numberDiff line change
@@ -385,3 +385,26 @@ and [user guide](https://openssl.org/docs/fips/UserGuide-2.0.pdf).
385385
`/usr/local/ssl/fips-2.0`
386386
8. Build Node.js with `make -j`
387387
9. Verify with `node -p "process.versions.openssl"` (for example `1.0.2a-fips`)
388+
389+
## Building Node.js with external core modules
390+
391+
It is possible to specify one or more JavaScript text files to be bundled in
392+
the binary as builtin modules when building Node.js.
393+
394+
### Unix / macOS
395+
396+
This command will make `/root/myModule.js` available via
397+
`require('/root/myModule')` and `./myModule2.js` available via
398+
`require('myModule2')`.
399+
400+
```console
401+
$ ./configure --link-module '/root/myModule.js' --link-module './myModule2.js'
402+
```
403+
404+
### Windows
405+
406+
To make `./myCustomModule.js` available via `require('myCustomModule')`.
407+
408+
```console
409+
> .\vcbuild link-module './myCustomModule.js'
410+
```

0 commit comments

Comments
 (0)