+21
| 'use strict'; | ||
| const MODULE_REQUIRE = 1 | ||
| /* built-in */ | ||
| , path = require('path') | ||
| /* NPM */ | ||
| /* in-package */ | ||
| , getCallerFileName = require('./lib/getCallerFileName') | ||
| , getCallerPackageDir = require('./lib/getCallerPackageDir') | ||
| , getCallerDir = () => path.dirname(getCallerFileName(1)) | ||
| ; | ||
| function bindings(name) { | ||
| let dirname = getCallerPackageDir(); | ||
| let pathname = path.join(dirname, 'build', 'Release', name); | ||
| return require(pathname); | ||
| } | ||
| module.exports = bindings; |
+4
-0
@@ -5,2 +5,6 @@ # noda Change Log | ||
| ## [0.4.0] - April 1st, 2018 - BETA | ||
| * `noda.bindings()` added. | ||
| ## [0.3.0] - Feb 21st, 2018 | ||
@@ -7,0 +11,0 @@ |
+2
-0
@@ -341,2 +341,4 @@ /** | ||
| module.exports = { | ||
| bindings: require('./bindings'), | ||
| currentPackage, | ||
@@ -343,0 +345,0 @@ inExists, |
+1
-1
| { | ||
| "name": "noda", | ||
| "version": "0.3.0", | ||
| "version": "0.4.0", | ||
| "description": "NOde Developing Assistant", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
+4
-0
@@ -43,2 +43,6 @@ # noda | ||
| * __noda.bindings__(string *name*) | ||
| Require an addon.node. | ||
| This method is allowed to be required as `noda/bindings`. | ||
| * __noda.currentPackage__() | ||
@@ -45,0 +49,0 @@ Return the object parsed from package.json which belongs to current package. |
20290
3.7%8
14.29%429
4.13%132
3.13%8
14.29%