summaryrefslogtreecommitdiff
path: root/tests/registry/npm/@denotest/node-addon-implicit-node-gyp/1.0.0
diff options
context:
space:
mode:
Diffstat (limited to 'tests/registry/npm/@denotest/node-addon-implicit-node-gyp/1.0.0')
-rw-r--r--tests/registry/npm/@denotest/node-addon-implicit-node-gyp/1.0.0/binding.gyp8
-rw-r--r--tests/registry/npm/@denotest/node-addon-implicit-node-gyp/1.0.0/index.js1
-rw-r--r--tests/registry/npm/@denotest/node-addon-implicit-node-gyp/1.0.0/package.json7
-rw-r--r--tests/registry/npm/@denotest/node-addon-implicit-node-gyp/1.0.0/src/binding.cc29
4 files changed, 45 insertions, 0 deletions
diff --git a/tests/registry/npm/@denotest/node-addon-implicit-node-gyp/1.0.0/binding.gyp b/tests/registry/npm/@denotest/node-addon-implicit-node-gyp/1.0.0/binding.gyp
new file mode 100644
index 000000000..5f3293064
--- /dev/null
+++ b/tests/registry/npm/@denotest/node-addon-implicit-node-gyp/1.0.0/binding.gyp
@@ -0,0 +1,8 @@
+{
+ 'targets': [
+ {
+ 'target_name': 'node_addon',
+ 'sources': [ 'src/binding.cc' ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/tests/registry/npm/@denotest/node-addon-implicit-node-gyp/1.0.0/index.js b/tests/registry/npm/@denotest/node-addon-implicit-node-gyp/1.0.0/index.js
new file mode 100644
index 000000000..540bfd82a
--- /dev/null
+++ b/tests/registry/npm/@denotest/node-addon-implicit-node-gyp/1.0.0/index.js
@@ -0,0 +1 @@
+module.exports.hello = require('./build/Release/node_addon').hello; \ No newline at end of file
diff --git a/tests/registry/npm/@denotest/node-addon-implicit-node-gyp/1.0.0/package.json b/tests/registry/npm/@denotest/node-addon-implicit-node-gyp/1.0.0/package.json
new file mode 100644
index 000000000..a77066711
--- /dev/null
+++ b/tests/registry/npm/@denotest/node-addon-implicit-node-gyp/1.0.0/package.json
@@ -0,0 +1,7 @@
+{
+ "name": "@denotest/node-addon-implicit-node-gyp",
+ "version": "1.0.0",
+ "scripts": {
+ "install": "node-gyp configure build"
+ }
+} \ No newline at end of file
diff --git a/tests/registry/npm/@denotest/node-addon-implicit-node-gyp/1.0.0/src/binding.cc b/tests/registry/npm/@denotest/node-addon-implicit-node-gyp/1.0.0/src/binding.cc
new file mode 100644
index 000000000..188b7c7dc
--- /dev/null
+++ b/tests/registry/npm/@denotest/node-addon-implicit-node-gyp/1.0.0/src/binding.cc
@@ -0,0 +1,29 @@
+// hello.cc using Node-API
+#include <node_api.h>
+
+namespace demo {
+
+napi_value Method(napi_env env, napi_callback_info args) {
+ napi_value greeting;
+ napi_status status;
+
+ status = napi_create_string_utf8(env, "world", NAPI_AUTO_LENGTH, &greeting);
+ if (status != napi_ok) return nullptr;
+ return greeting;
+}
+
+napi_value init(napi_env env, napi_value exports) {
+ napi_status status;
+ napi_value fn;
+
+ status = napi_create_function(env, nullptr, 0, Method, nullptr, &fn);
+ if (status != napi_ok) return nullptr;
+
+ status = napi_set_named_property(env, exports, "hello", fn);
+ if (status != napi_ok) return nullptr;
+ return exports;
+}
+
+NAPI_MODULE(NODE_GYP_MODULE_NAME, init)
+
+} // namespace demo \ No newline at end of file