Skip to content

Commit 896aa77

Browse files
SuixinleiMylesBorins
authored andcommitted
doc: add builtin module in building.md
Fixes: #12516 Refs: #2497 PR-URL: #17705 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 5f1803b commit 896aa77

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

BUILDING.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,3 +409,26 @@ and [user guide](https://openssl.org/docs/fips/UserGuide-2.0.pdf).
409409
`/usr/local/ssl/fips-2.0`
410410
8. Build Node.js with `make -j`
411411
9. Verify with `node -p "process.versions.openssl"` (for example `1.0.2a-fips`)
412+
413+
## Building Node.js with external core modules
414+
415+
It is possible to specify one or more JavaScript text files to be bundled in
416+
the binary as builtin modules when building Node.js.
417+
418+
### Unix / macOS
419+
420+
This command will make `/root/myModule.js` available via
421+
`require('/root/myModule')` and `./myModule2.js` available via
422+
`require('myModule2')`.
423+
424+
```console
425+
$ ./configure --link-module '/root/myModule.js' --link-module './myModule2.js'
426+
```
427+
428+
### Windows
429+
430+
To make `./myCustomModule.js` available via `require('myCustomModule')`.
431+
432+
```console
433+
> .\vcbuild link-module './myCustomModule.js'
434+
```

0 commit comments

Comments
 (0)