Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added node-pre-gyp #87

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Release/electron-v4.2-win32-x64/nsfw.node
Binary file not shown.
Binary file added Release/node-v64-win32-x64/nsfw.node
Binary file not shown.
15 changes: 15 additions & 0 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,20 @@
]
}],
]
},
{
"target_name": "action_after_build",
"type": "none",
"dependencies": [
"<(module_name)"
],
"copies": [
{
"files": [
"<(PRODUCT_DIR)/<(module_name).node"
],
"destination": "<(module_path)"
}
]
}]
}
4 changes: 3 additions & 1 deletion js/src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const { NSFW } = require('../../build/Release/nsfw.node');
const binary = require('node-pre-gyp');
const fse = require('fs-extra');
const path = require('path');
const binding_path = binary.find(path.resolve(path.join(__dirname,'../../','./package.json')));
const { NSFW } = require(binding_path);
const _isInteger = require('lodash.isinteger');
const _isUndefined = require('lodash.isundefined');

Expand Down
13 changes: 11 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"eslint": "eslint js/src js/spec",
"prepublish": "babel --presets es2015 -d ./lib/src ./js/src",
"debug-test": "npm run eslint && npm run compile && node-debug --debug-brk jasmine-node lib/spec",
"test": "npm run eslint && npm run compile && jasmine-node lib/spec --verbose"
"test": "npm run eslint && npm run compile && jasmine-node lib/spec --verbose",
"install": "node-pre-gyp install --fallback-to-build"
},
"repository": {
"type": "git",
Expand All @@ -24,6 +25,7 @@
"typings.d.ts",
"lib",
"src",
"Release",
"includes",
"binding.gyp"
],
Expand All @@ -33,7 +35,8 @@
"fs-extra": "^7.0.0",
"lodash.isinteger": "^4.0.4",
"lodash.isundefined": "^3.0.1",
"nan": "^2.0.0"
"nan": "^2.0.0",
"node-pre-gyp": "0.6.x"
},
"devDependencies": {
"babel-cli": "^6.5.1",
Expand All @@ -42,6 +45,12 @@
"executive": "^1.6.3",
"jasmine-node": "^2.0.1"
},
"binary": {
"module_name": "nsfw",
"module_path": "./Release/{node_abi}-{platform}-{arch}/",
"package_name": "{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz",
"host": "https://www.npmjs.com/package/nsfw"
},
"keywords": [
"FileWatcher",
"files",
Expand Down