command-stream 0.0.3 → 0.0.4

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/$.mjs +4 -0
  2. package/package.json +1 -1
package/$.mjs CHANGED
@@ -5,6 +5,9 @@
5
5
  // 3. EventEmitter: $`command`.on('data', chunk => ...).on('end', result => ...)
6
6
  // 4. Stream access: $`command`.stdout, $`command`.stderr
7
7
 
8
+ import { createRequire } from 'module';
9
+ import { fileURLToPath } from 'url';
10
+
8
11
  const isBun = typeof globalThis.Bun !== 'undefined';
9
12
 
10
13
  // Global shell settings (like bash set -e / set +e)
@@ -878,6 +881,7 @@ class ProcessRunner extends StreamEmitter {
878
881
  result.child = proc;
879
882
  } else {
880
883
  // Use Node's synchronous spawn
884
+ const require = createRequire(import.meta.url);
881
885
  const cp = require('child_process');
882
886
  const proc = cp.spawnSync(argv[0], argv.slice(1), {
883
887
  cwd,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "command-stream",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "Modern $ shell utility library with streaming, async iteration, and EventEmitter support, optimized for Bun runtime",
5
5
  "type": "module",
6
6
  "main": "$.mjs",