Skip to content

Commit

Permalink
Merge pull request #551 from NickNaso/node-addon-api
Browse files Browse the repository at this point in the history
bcrypt for Node.js with Node addon api
  • Loading branch information
recrsn authored Dec 12, 2017
2 parents 99e2a09 + 30c8dc7 commit 3edea5f
Show file tree
Hide file tree
Showing 7 changed files with 154 additions and 192 deletions.
5 changes: 1 addition & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ os:
- osx

node_js:
- "0.8"
- "0.10"
- "0.12"
- "4"
- "5"
- "6"
- "7"
- "8"
- "9"

addons:
apt:
Expand All @@ -29,7 +27,6 @@ before_install:
- echo Building for Node $TRAVIS_NODE_VERSION
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export CXX=$LINUX_CXX; $CXX --version; fi;
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then c++ --version; fi;
- if [[ $(echo "$TRAVIS_NODE_VERSION <= 0.12" | bc -l) ]]; then npm install -g npm@2; else npm install -g npm@latest; fi;

install: true

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ The code for this comes from a few sources:
* [Sean McArthur][seanmonstar] - Windows Support
* [Fanie Oosthuysen][weareu] - Windows Support
* [Amitosh Swain Mahapatra][agathver] - ES6 Promise Support
* [Nicola Del Gobbo][NickNaso] - Initial implementation with N-API

## License
Unless stated elsewhere, file headers or otherwise, the license as stated in the LICENSE file.
Expand Down Expand Up @@ -281,3 +282,4 @@ Unless stated elsewhere, file headers or otherwise, the license as stated in the
[seanmonstar]:https://github.com/seanmonstar
[weareu]:https://github.com/weareu
[agathver]:https://github.com/Agathver
[NickNaso]: https://github.com/NickNaso
10 changes: 1 addition & 9 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
environment:
matrix:
- nodejs_version: "0.10"
platform: x64
- nodejs_version: "0.10"
platform: x86
- nodejs_version: "0.12"
platform: x64
- nodejs_version: "0.12"
platform: x86
- nodejs_version: "4"
platform: x64
- nodejs_version: "4"
Expand All @@ -27,7 +19,7 @@ environment:
- nodejs_version: "8"
platform: x64
- nodejs_version: "8"
platform: x86
platform: x86

install:
- where npm
Expand Down
25 changes: 20 additions & 5 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,31 @@
'src/bcrypt.cc',
'src/bcrypt_node.cc'
],
'cflags!': [ '-fno-exceptions' ],
'cflags_cc!': [ '-fno-exceptions' ],
'include_dirs' : [
"<!(node -e \"require('nan')\")"
],
"<!@(node -p \"require('node-addon-api').include\")"
],
'dependencies': ["<!(node -p \"require('node-addon-api').gyp\")"],
'conditions': [
[ 'OS=="win"', {
['OS=="win"', {
"msvs_settings": {
"VCCLCompilerTool": {
"ExceptionHandling": 1
}
},
'defines': [
'uint=unsigned int',
],
]
}],
],
['OS=="mac"', {
"xcode_settings": {
"CLANG_CXX_LIBRARY": "libc++",
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'MACOSX_DEPLOYMENT_TARGET': '10.7'
}
}]
]
},
{
"target_name": "action_after_build",
Expand Down
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": "1.0.3",
"author": "Nick Campbell (https://github.com/ncb000gt)",
"engines": {
"node": ">= 0.6.0"
"node": ">= 4.0.0"
},
"repository": {
"type": "git",
Expand All @@ -29,8 +29,9 @@
"install": "node-pre-gyp install --fallback-to-build"
},
"dependencies": {
"nan": "2.6.2",
"node-pre-gyp": "0.6.36"
"bindings": "1.3.0",
"node-addon-api": "1.1.0",
"node-pre-gyp": "0.6.39"
},
"devDependencies": {
"nodeunit": "~0.9.1"
Expand All @@ -50,7 +51,8 @@
"Nate Rajlich <[email protected]> (https://github.com/tootallnate)",
"Sean McArthur <[email protected]> (https://github.com/seanmonstar)",
"Fanie Oosthuysen <[email protected]> (https://github.com/weareu)",
"Amitosh Swain Mahapatra <[email protected]> (https://github.com/Agathver)"
"Amitosh Swain Mahapatra <[email protected]> (https://github.com/Agathver)",
"Nicola Del Gobbo <[email protected]> (https://github.com/NickNaso)"
],
"binary": {
"module_name": "bcrypt_lib",
Expand Down
Loading

0 comments on commit 3edea5f

Please sign in to comment.