From a750ea9e2c2ecaf319ecc5d7fc70708d39578f07 Mon Sep 17 00:00:00 2001 From: Jason Ginchereau Date: Mon, 27 Feb 2017 15:54:22 -0800 Subject: [PATCH 1/4] Enable include files via package dependency --- include_dirs.js | 1 + package.json | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 include_dirs.js create mode 100644 package.json diff --git a/include_dirs.js b/include_dirs.js new file mode 100644 index 000000000..4f1dfb416 --- /dev/null +++ b/include_dirs.js @@ -0,0 +1 @@ +console.log(require('path').relative('.', __dirname)); diff --git a/package.json b/package.json new file mode 100644 index 000000000..5c307e972 --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "bugs": { + "url": "https://github.com/nodejs/abi-stable-node-wrapper/issues" + }, + "dependencies": {}, + "description": "Node.js API (NAPI) C++ Wrapper", + "devDependencies": { + }, + "directories": {}, + "homepage": "https://github.com/nodejs/abi-stable-node-wrapper", + "license": "MIT", + "main": "include_dirs.js", + "name": "napi", + "optionalDependencies": {}, + "readme": "README.md", + "repository": { + "type": "git", + "url": "git://github.com/nodejs/abi-stable-node-wrapper.git" + }, + "scripts": { + }, + "version": "0.1.0" +} From c17a45c2e6c94fc5601ae6e9739182b489b20485 Mon Sep 17 00:00:00 2001 From: Jason Ginchereau Date: Fri, 17 Mar 2017 12:35:16 -0700 Subject: [PATCH 2/4] Update package name, readme, js --- README.md | 23 ++++++++++++++++++++--- include_dirs.js | 1 - index.js | 7 +++++++ package.json | 6 +++--- 4 files changed, 30 insertions(+), 7 deletions(-) delete mode 100644 include_dirs.js create mode 100644 index.js diff --git a/README.md b/README.md index cdde45cac..704ed08a0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,22 @@ -# Node.js API (NAPI) C++ Wrapper +# Node.js API (N-API) Package -This repo contains header-only C++ wrapper classes for the C APIs for the ABI Stable Node API project (NAPI). +This package contains header-only C++ wrapper classes for the ABI-stable +Node.js API (N-API). -See the [main project README](https://github.com/nodejs/abi-stable-node/blob/doc/README.md) for more details. +To use these headers in a native module: + 1. Add a dependency on this package to `package.json`. + 2. Reference this package's include directory in `binding.gyp`: +```json +{ + 'target_name': 'example_module', + 'include_dirs': ["= 52; + +module.exports = { + include: include, + isNodeApiBuiltin: isNodeApiBuiltin, +}; diff --git a/package.json b/package.json index 5c307e972..eaa304d7c 100644 --- a/package.json +++ b/package.json @@ -3,14 +3,14 @@ "url": "https://github.com/nodejs/abi-stable-node-wrapper/issues" }, "dependencies": {}, - "description": "Node.js API (NAPI) C++ Wrapper", + "description": "Node.js API (N-API)", "devDependencies": { }, "directories": {}, "homepage": "https://github.com/nodejs/abi-stable-node-wrapper", "license": "MIT", - "main": "include_dirs.js", - "name": "napi", + "main": "index.js", + "name": "node-api", "optionalDependencies": {}, "readme": "README.md", "repository": { From 917f5dab1ca8fcb840d5a1da1c4669285dd74e4a Mon Sep 17 00:00:00 2001 From: Jason Ginchereau Date: Fri, 17 Mar 2017 12:40:58 -0700 Subject: [PATCH 3/4] Update repo URLs in package.json --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index eaa304d7c..b007b084f 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,13 @@ { "bugs": { - "url": "https://github.com/nodejs/abi-stable-node-wrapper/issues" + "url": "https://github.com/nodejs/node-api/issues" }, "dependencies": {}, "description": "Node.js API (N-API)", "devDependencies": { }, "directories": {}, - "homepage": "https://github.com/nodejs/abi-stable-node-wrapper", + "homepage": "https://github.com/nodejs/node-api", "license": "MIT", "main": "index.js", "name": "node-api", @@ -15,7 +15,7 @@ "readme": "README.md", "repository": { "type": "git", - "url": "git://github.com/nodejs/abi-stable-node-wrapper.git" + "url": "git://github.com/nodejs/node-api.git" }, "scripts": { }, From 99d9539f7ffc171ecd111c08ff4922f939c3adbb Mon Sep 17 00:00:00 2001 From: Jason Ginchereau Date: Fri, 17 Mar 2017 12:43:25 -0700 Subject: [PATCH 4/4] Fix syntax highlighting in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 704ed08a0..4156b574a 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Node.js API (N-API). To use these headers in a native module: 1. Add a dependency on this package to `package.json`. 2. Reference this package's include directory in `binding.gyp`: -```json +```gyp { 'target_name': 'example_module', 'include_dirs': ["