Skip to content

Commit 9d46bcb

Browse files
authored
Prepare for publish to npm (#33)
- Change package name from "node-api" to "node-addon-api" - Add license file - Add contributors list to package.json and readme - Add preliminary doc link to readme
1 parent 3066c06 commit 9d46bcb

File tree

6 files changed

+56
-12
lines changed

6 files changed

+56
-12
lines changed

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/test/
2+
.npmignore

LICENSE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
The MIT License (MIT)
2+
=====================
3+
4+
Copyright (c) 2017 Node.js API collaborators
5+
-----------------------------------
6+
7+
*Node.js API collaborators listed at <https://github.com/nodejs/node-api#collaborators>*
8+
9+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,17 @@ backward-compatibility with use with older versions of Node.js that do
66
not have N-API built-in.
77

88
To use N-API in a native module:
9-
1. Add a dependency on this package to `package.json`.
10-
It is not yet published to npm, so reference it directly from GitHub.
9+
1. Add a dependency on this package to `package.json`:
1110
```json
1211
"dependencies": {
13-
"node-api": "github:nodejs/node-api",
12+
"node-addon-api": "github:nodejs/node-addon-api",
1413
}
1514
```
1615

1716
2. Reference this package's include directory and gyp file in `binding.gyp`:
1817
```gyp
19-
'include_dirs': ["<!(node -p \"require('node-api').include\")"],
20-
'dependencies': ["<!(node -p \"require('node-api').gyp\")"],
18+
'include_dirs': ["<!(node -p \"require('node-addon-api').include\")"],
19+
'dependencies': ["<!(node -p \"require('node-addon-api').gyp\")"],
2120
```
2221

2322
3. Ensure C++ exceptions are enabled in `binding.gyp`.
@@ -33,13 +32,30 @@ To use N-API in a native module:
3332
```
3433

3534
4. Include `napi.h` in the native module code.
36-
To ensure only ABI-stable APIs are used, DO NOT include `node.h` or `v8.h`.
35+
To ensure only ABI-stable APIs are used, DO NOT include
36+
`node.h`, `nan.h`, or `v8.h`.
3737
```C++
3838
#include "napi.h"
3939
```
4040

41-
At build time, the N-API back-compat library code will be used only when the targeted node version *does not* have N-API built-in.
41+
At build time, the N-API back-compat library code will be used only when the
42+
targeted node version *does not* have N-API built-in.
4243

4344
See the [main project README](
4445
https://github.com/nodejs/abi-stable-node/blob/doc/README.md)
46+
or [preliminary documentation](https://github.com/nodejs/node/blob/v8.x/doc/api/n-api.md)
4547
for more details about N-API.
48+
49+
<a name="collaborators"></a>
50+
### WG Members / Collaborators
51+
| Name | GitHub link |
52+
| ------------------- | ------------------------------------------------------ |
53+
| Anna Henningsen | [@addaleax](https://github.com/addaleax) |
54+
| Arunesh Chandra | [@aruneshchandra](https://github.com/aruneshchandra) |
55+
| Benjamin Byholm | [@kkoopa](https://github.com/kkoopa) |
56+
| Gabriel Schulhof | [@gabrielschulhof](https://github.com/gabrielschulhof) |
57+
| Hitesh Kanwathirtha | [@digitalinfinity](https://github.com/digitalinfinity) |
58+
| Jason Ginchereau | [@jasongin](https://github.com/jasongin) |
59+
| Michael Dawson | [@mhdawson](https://github.com/mhdawson) |
60+
| Sampson Gao | [@sampsongao](https://github.com/sampsongao) |
61+
| Taylor Woll | [@boingoing](https://github.com/boingoing) |

napi-inl.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
#define SRC_NAPI_INL_H_
33

44
////////////////////////////////////////////////////////////////////////////////
5-
// NAPI C++ Wrapper Classes
5+
// N-API C++ Wrapper Classes
66
//
7-
// Inline header-only implementations for "NAPI" ABI-stable C APIs for Node.js.
7+
// Inline header-only implementations for "N-API" ABI-stable C APIs for Node.js.
88
////////////////////////////////////////////////////////////////////////////////
99

10+
// Note: Do not include this file directly! Include "napi.h" instead.
11+
1012
#include <cassert>
1113
#include <cstring>
1214

napi.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
#define SRC_NAPI_H_
33

44
////////////////////////////////////////////////////////////////////////////////
5-
// NAPI C++ Wrapper Classes
5+
// N-API C++ Wrapper Classes
66
//
7-
// These classes wrap the "NAPI" ABI-stable C APIs for Node.js, providing a
7+
// These classes wrap the "N-API" ABI-stable C APIs for Node.js, providing a
88
// C++ object model and C++ exception-handling semantics with low overhead.
99
// The wrappers are all header-only so that they do not affect the ABI.
1010
////////////////////////////////////////////////////////////////////////////////

package.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22
"bugs": {
33
"url": "https://github.com/nodejs/node-api/issues"
44
},
5+
"contributors": [
6+
"Anna Henningsen (https://github.com/addaleax)",
7+
"Arunesh Chandra (https://github.com/aruneshchandra)",
8+
"Benjamin Byholm (https://github.com/kkoopa)",
9+
"Gabriel Schulhof (https://github.com/gabrielschulhof)",
10+
"Hitesh Kanwathirtha (https://github.com/digitalinfinity)",
11+
"Jason Ginchereau (https://github.com/jasongin)",
12+
"Michael Dawson (https://github.com/mhdawson)",
13+
"Sampson Gao (https://github.com/sampsongao)",
14+
"Taylor Woll (https://github.com/boingoing)"
15+
],
516
"dependencies": {},
617
"description": "Node.js API (N-API)",
718
"devDependencies": {
@@ -11,7 +22,7 @@
1122
"homepage": "https://github.com/nodejs/node-api",
1223
"license": "MIT",
1324
"main": "index.js",
14-
"name": "node-api",
25+
"name": "node-addon-api",
1526
"optionalDependencies": {},
1627
"readme": "README.md",
1728
"repository": {

0 commit comments

Comments
 (0)