koffi 2.3.6-beta.4 → 2.3.6-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/package.json +2 -2
  2. package/src/koffi/build/{2.3.6-beta.4 → 2.3.6-beta.6}/koffi_darwin_arm64/koffi.node +0 -0
  3. package/src/koffi/build/{2.3.6-beta.4 → 2.3.6-beta.6}/koffi_darwin_x64/koffi.node +0 -0
  4. package/src/koffi/build/{2.3.6-beta.4 → 2.3.6-beta.6}/koffi_win32_arm64/koffi.node +0 -0
  5. package/src/koffi/build/{2.3.6-beta.4 → 2.3.6-beta.6}/koffi_win32_arm64/koffi.pdb +0 -0
  6. package/src/koffi/build/{2.3.6-beta.4 → 2.3.6-beta.6}/koffi_win32_ia32/koffi.node +0 -0
  7. package/src/koffi/build/{2.3.6-beta.4 → 2.3.6-beta.6}/koffi_win32_ia32/koffi.pdb +0 -0
  8. package/src/koffi/build/{2.3.6-beta.4 → 2.3.6-beta.6}/koffi_win32_x64/koffi.node +0 -0
  9. package/src/koffi/build/{2.3.6-beta.4 → 2.3.6-beta.6}/koffi_win32_x64/koffi.pdb +0 -0
  10. package/src/koffi/src/index.js +18 -10
  11. /package/src/koffi/build/{2.3.6-beta.4 → 2.3.6-beta.6}/koffi_freebsd_arm64/koffi.node +0 -0
  12. /package/src/koffi/build/{2.3.6-beta.4 → 2.3.6-beta.6}/koffi_freebsd_ia32/koffi.node +0 -0
  13. /package/src/koffi/build/{2.3.6-beta.4 → 2.3.6-beta.6}/koffi_freebsd_x64/koffi.node +0 -0
  14. /package/src/koffi/build/{2.3.6-beta.4 → 2.3.6-beta.6}/koffi_linux_arm32hf/koffi.node +0 -0
  15. /package/src/koffi/build/{2.3.6-beta.4 → 2.3.6-beta.6}/koffi_linux_arm64/koffi.node +0 -0
  16. /package/src/koffi/build/{2.3.6-beta.4 → 2.3.6-beta.6}/koffi_linux_ia32/koffi.node +0 -0
  17. /package/src/koffi/build/{2.3.6-beta.4 → 2.3.6-beta.6}/koffi_linux_riscv64hf64/koffi.node +0 -0
  18. /package/src/koffi/build/{2.3.6-beta.4 → 2.3.6-beta.6}/koffi_linux_x64/koffi.node +0 -0
  19. /package/src/koffi/build/{2.3.6-beta.4 → 2.3.6-beta.6}/koffi_openbsd_ia32/koffi.node +0 -0
  20. /package/src/koffi/build/{2.3.6-beta.4 → 2.3.6-beta.6}/koffi_openbsd_x64/koffi.node +0 -0
  21. /package/src/koffi/build/{2.3.6-beta.4 → 2.3.6-beta.6}/koffi_win32_arm64/koffi.exp +0 -0
  22. /package/src/koffi/build/{2.3.6-beta.4 → 2.3.6-beta.6}/koffi_win32_arm64/koffi.lib +0 -0
  23. /package/src/koffi/build/{2.3.6-beta.4 → 2.3.6-beta.6}/koffi_win32_ia32/koffi.exp +0 -0
  24. /package/src/koffi/build/{2.3.6-beta.4 → 2.3.6-beta.6}/koffi_win32_ia32/koffi.lib +0 -0
  25. /package/src/koffi/build/{2.3.6-beta.4 → 2.3.6-beta.6}/koffi_win32_x64/koffi.exp +0 -0
  26. /package/src/koffi/build/{2.3.6-beta.4 → 2.3.6-beta.6}/koffi_win32_x64/koffi.lib +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koffi",
3
- "version": "2.3.6-beta.4",
3
+ "version": "2.3.6-beta.6",
4
4
  "stable": "2.3.5",
5
5
  "description": "Fast and simple C FFI (foreign function interface) for Node.js",
6
6
  "keywords": [
@@ -26,7 +26,7 @@
26
26
  "license": "LGPL-3.0",
27
27
  "cnoke": {
28
28
  "napi": 8,
29
- "require": "./src/koffi/build/{{version}}/koffi_{{platform}}_{{arch}}/koffi.node",
29
+ "require": "./src/koffi/src/index.js",
30
30
  "output": "src/koffi/build/{{version}}/koffi_{{platform}}_{{arch}}"
31
31
  }
32
32
  }
@@ -13,29 +13,37 @@
13
13
 
14
14
  'use strict';
15
15
 
16
- const package = require('../package.json');
17
- const cnoke = require('../../cnoke');
16
+ const cnoke = require('../../cnoke/src/index.js');
18
17
  const util = require('util');
19
18
 
20
- if (process.versions.napi == null || process.versions.napi < 8) {
19
+ const pkg = (() => {
20
+ try {
21
+ return require('../../../package.json');
22
+ } catch (err) {
23
+ return require('../package.json');
24
+ }
25
+ })();
26
+
27
+ if (process.versions.napi == null || process.versions.napi < pkg.cnoke.napi) {
21
28
  let major = parseInt(process.versions.node, 10);
22
- let required = cnoke.get_napi_version(8, major);
29
+ let required = cnoke.get_napi_version(pkg.cnoke.napi, major);
23
30
 
24
31
  if (required != null) {
25
- throw new Error(`Project ${pkg.name} requires Node >= ${required} in the Node ${major}.x branch (N-API >= 8)`);
32
+ throw new Error(`Project ${pkg.name} requires Node >= ${required} in the Node ${major}.x branch (N-API >= ${pkg.cnoke.napi})`);
26
33
  } else {
27
- throw new Error(`Project ${pkg.name} does not support the Node ${major}.x branch (N-API < 8)`);
34
+ throw new Error(`Project ${pkg.name} does not support the Node ${major}.x branch (N-API < ${pkg.cnoke.napi})`);
28
35
  }
29
36
  }
30
37
 
31
38
  let arch = cnoke.determine_arch();
32
- let filename = __dirname + `/../build/${package.version}/koffi_${process.platform}_${arch}/koffi.node`;
39
+ let filename = __dirname + `/../build/${pkg.version}/koffi_${process.platform}_${arch}/koffi.node`;
33
40
 
34
41
  // Development build
35
42
  if (!fs.existsSync(filename)) {
36
- let alternative = __dirname + '/../build/koffi.node';
37
- if (fs.existsSync(alternative))
38
- filename = alternative;
43
+ let dev_filename = __dirname + '/../build/koffi.node';
44
+
45
+ if (fs.existsSync(dev_filename))
46
+ filename = dev_filename;
39
47
  }
40
48
 
41
49
  let native = require(filename);