You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-2Lines changed: 10 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,18 @@
1
1
# nw-node-addon-gyp-example
2
2
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');`
0 commit comments