csvql-query 1.0.0 → 1.5.8

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 (2) hide show
  1. package/index.js +3 -11
  2. package/package.json +4 -10
package/index.js CHANGED
@@ -29,19 +29,11 @@ const os = require('os');
29
29
  const crypto = require('crypto');
30
30
 
31
31
  function findNative() {
32
- // 1. Bundled in same dir (npm run build copies it here, or local publish)
33
- const bundled = path.join(__dirname, 'csvql.node');
32
+ // 1. Bundled binary for this platform (npm published package)
33
+ const bundled = path.join(__dirname, 'binaries', `${process.platform}-${process.arch}.node`);
34
34
  if (fs.existsSync(bundled)) return bundled;
35
35
 
36
- // 2. Platform-specific npm package (installed via optionalDependencies)
37
- const pkg = `csvql-query-${process.platform}-${process.arch}`;
38
- try {
39
- const pkgDir = path.dirname(require.resolve(`${pkg}/package.json`));
40
- const bin = path.join(pkgDir, 'csvql.node');
41
- if (fs.existsSync(bin)) return bin;
42
- } catch (_) {}
43
-
44
- // 3. Dev build output (zig build node from repo root)
36
+ // 2. Dev build output (zig build node from repo root)
45
37
  const dev = path.join(__dirname, '..', 'zig-out', 'lib', 'csvql.node');
46
38
  if (fs.existsSync(dev)) return dev;
47
39
 
package/package.json CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "name": "csvql-query",
3
- "version": "1.0.0",
3
+ "version": "1.5.8",
4
4
  "description": "Fast SQL queries on CSV files — Zig/SIMD engine via N-API",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
7
7
  "files": [
8
8
  "index.js",
9
- "index.d.ts"
9
+ "index.d.ts",
10
+ "binaries/"
10
11
  ],
11
12
  "scripts": {
12
- "build": "zig build node -Doptimize=ReleaseFast && cp ../zig-out/lib/csvql.node .",
13
+ "build": "zig build node -Doptimize=ReleaseFast && mkdir -p binaries && cp ../zig-out/lib/csvql.node binaries/$(node -p \"process.platform + '-' + process.arch\").node",
13
14
  "test": "node test.js",
14
15
  "bench": "node bench.js"
15
16
  },
@@ -30,13 +31,6 @@
30
31
  "engines": {
31
32
  "node": ">=18"
32
33
  },
33
- "optionalDependencies": {
34
- "csvql-query-darwin-arm64": "1.0.0",
35
- "csvql-query-darwin-x64": "1.0.0",
36
- "csvql-query-linux-x64": "1.0.0",
37
- "csvql-query-linux-arm64": "1.0.0",
38
- "csvql-query-win32-x64": "1.0.0"
39
- },
40
34
  "devDependencies": {
41
35
  "csv-parse": "^7.0.0",
42
36
  "papaparse": "^5.5.4"