Skip to content

Commit b83b104

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 2e76df5 commit b83b104

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

0 commit comments

Comments
 (0)