Skip to content

Commit 24203c7

Browse files
author
Gabriel Schulhof
committed
Add newlines to the ends of files and update README.md.
1 parent 4dc85d8 commit 24203c7

File tree

18 files changed

+40
-27
lines changed

18 files changed

+40
-27
lines changed

1_hello_world/napi/hello.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
var addon = require('bindings')('hello');
22

3-
console.log(addon.hello()); // 'world'
3+
console.log(addon.hello()); // 'world'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
var addon = require('bindings')('hello');
22

3-
console.log(addon.hello()); // 'world'
3+
console.log(addon.hello()); // 'world'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
var addon = require('bindings')('addon.node')
22

3-
console.log('This should be eight:', addon.add(3, 5))
3+
console.log('This should be eight:', addon.add(3, 5))

3_callbacks/node-addon-api/addon.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ var addon = require('bindings')('addon');
22

33
addon(function(msg){
44
console.log(msg); // 'hello world'
5-
});
5+
});

4_object_factory/napi/addon.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ var addon = require('bindings')('addon');
22

33
var obj1 = addon('hello');
44
var obj2 = addon('world');
5-
console.log(obj1.msg+' '+obj2.msg); // 'hello world'
5+
console.log(obj1.msg+' '+obj2.msg); // 'hello world'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
var addon = require('bindings')('addon');
22

33
var fn = addon();
4-
console.log(fn()); // 'hello world'
4+
console.log(fn()); // 'hello world'

README.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,34 @@
1-
Node.js Addon Examples - ABI Stable PoC
1+
Node.js Addon Examples
22
=========================================
33

4-
This repository is the home of the Addon Examples as extended
5-
for the proof of concept work being done to develop an ABI
6-
stable API for use my node modules.
4+
This repository is the home of the Addon Examples.
75

8-
For more details please read the node-eps covering this effort.
9-
The current PR for the eps is: https://github.com/nodejs/node-eps/pull/20
6+
The directory structure is as follows:
107

11-
```text
12-
$ sudo npm install node-gyp -g
138
```
9+
<name of example>
10+
|
11+
+--- <implementation 1>
12+
| |
13+
| +--- files...
14+
+--- <implementation 2>
15+
. |
16+
. +--- files...
17+
.
18+
```
19+
20+
Implementations are named either after Node.js versions (`node_0.10`,
21+
`node_0.12`, etc), or Node.js addon implementation APIs (`nan`, `napi`,
22+
or `node-addon-api`).
1423

15-
In each example directory, run:
24+
Implementations against unsupported versions of Node.js are provided for
25+
completess and historical context. They are not maintained.
26+
27+
In each example's implementation subdirectory, run
1628

1729
```text
1830
$ npm install
19-
$ node-gyp rebuild
2031
$ node ./
2132
```
33+
34+
to see the example in action.

async_pi_estimate/nan/addon.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ function runAsync() {
4141
}
4242

4343
runSync();
44-
runAsync();
44+
runAsync();

async_pi_estimate/node-addon-api/addon.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ Napi::Object Init(Napi::Env env, Napi::Object exports) {
1010
return exports;
1111
}
1212

13-
NODE_API_MODULE(NODE_GYP_MODULE_NAME, Init)
13+
NODE_API_MODULE(NODE_GYP_MODULE_NAME, Init)

async_pi_estimate/node-addon-api/async.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ Napi::Value CalculateAsync(const Napi::CallbackInfo& info) {
3636
PiWorker* piWorker = new PiWorker(callback, points);
3737
piWorker->Queue();
3838
return info.Env().Undefined();
39-
}
39+
}

0 commit comments

Comments
 (0)