@taleshape/shaper 0.1.0 → 0.1.1

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/package.json +2 -2
  2. package/shaper.js +20 -0
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@taleshape/shaper",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Minimal Embedded Analytics and Data Platform",
5
5
  "main": "index.js",
6
6
  "bin": {
7
- "shaper": "./bin/shaper"
7
+ "shaper": "./shaper.js"
8
8
  },
9
9
  "scripts": {
10
10
  "postinstall": "node install.js",
package/shaper.js ADDED
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env node
2
+
3
+ const path = require('path');
4
+ const { spawn } = require('child_process');
5
+
6
+ const binaryPath = path.join(__dirname, 'bin', 'shaper');
7
+
8
+ // Forward all arguments to the binary
9
+ const args = process.argv.slice(2);
10
+
11
+ // Spawn the binary with the forwarded arguments
12
+ const child = spawn(binaryPath, args, {
13
+ stdio: 'inherit',
14
+ shell: false
15
+ });
16
+
17
+ // Forward the exit code
18
+ child.on('exit', (code) => {
19
+ process.exit(code);
20
+ });