Skip to content

Commit 1c2d830

Browse files
chore(docs): add approach section
1 parent 14a11c0 commit 1c2d830

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
# nw-node-addon-gyp-example
22

3-
Build Node Addon using `node-gyp`. NW.js Node headers are downloaded and passed to `node-gyp` via the `--nodedir` parameter.
3+
Build Node Addon using `node-gyp`.
4+
5+
## Approach
6+
7+
1. Download NW.js Node headers tarball from https://dl.nwjs.io. For example, for headers for v0.99.1 can be downloaded [here](https://dl.nwjs.io/v0.99.1/nw-headers-v0.99.1.tar.gz).
8+
1. Get the Node version used by the NW.js release version from https://nwjs.io/versions.json. For example, for v0.99.1 the Node version is 23.11.0
9+
1. (Re)build Node addons for NW.js: `node-gyp rebuild --target=23.11.0 --nodedir=/path/to/node/headers/directory`
10+
1. The compiled addon will be at `$PWD/build/Release/{addon_name}.node`. For example, if the `target` value in your `binding.gyp` file is `hello`, then the file will be `$PWD/build/Release/hello.node`.
11+
1. Import the module inside your application: `const { hello } = require('./build/Release/hello');`
412

513
Note: This approach works from v0.83 onward.
614

7-
## Getting Started
15+
## Getting Started with demo application
816

917
1. Clone repo
1018
1. `npm i` to install Node modules

0 commit comments

Comments
 (0)