diff options
author | Suixinlei <joshuasui@163.com> | 2017-12-16 13:19:16 +0800 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2018-01-18 21:36:32 +0800 |
commit | f2e62b52385ff5e778d997ba86db70975e5670c7 (patch) | |
tree | 706fdc1d697ecebb119ec129ebd7811517f552b8 /BUILDING.md | |
parent | c134ff24f44ca523566bd38aa2d49f0dce7401aa (diff) | |
download | node-new-f2e62b52385ff5e778d997ba86db70975e5670c7.tar.gz |
doc: add builtin module in building.md
Fixes: https://github.com/nodejs/node/issues/12516
Refs: https://github.com/nodejs/node/pull/2497
PR-URL: https://github.com/nodejs/node/pull/17705
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'BUILDING.md')
-rw-r--r-- | BUILDING.md | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/BUILDING.md b/BUILDING.md index 10e9a910be..74b5903ed2 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -403,3 +403,26 @@ and [user guide](https://openssl.org/docs/fips/UserGuide-2.0.pdf). `/usr/local/ssl/fips-2.0` 8. Build Node.js with `make -j` 9. Verify with `node -p "process.versions.openssl"` (for example `1.0.2a-fips`) + +## Building Node.js with external core modules + +It is possible to specify one or more JavaScript text files to be bundled in +the binary as builtin modules when building Node.js. + +### Unix / macOS + +This command will make `/root/myModule.js` available via +`require('/root/myModule')` and `./myModule2.js` available via +`require('myModule2')`. + +```console +$ ./configure --link-module '/root/myModule.js' --link-module './myModule2.js' +``` + +### Windows + +To make `./myCustomModule.js` available via `require('myCustomModule')`. + +```console +> .\vcbuild link-module './myCustomModule.js' +``` |