command-stream 0.0.1 β†’ 0.0.2

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/README.md +43 -41
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,9 +1,11 @@
1
- # command-$tream
1
+ # [command-$tream](https://github.com/link-foundation/command-stream)
2
2
 
3
3
  $treamable commands executor
4
4
 
5
5
  A modern $ shell utility library with streaming, async iteration, and EventEmitter support, optimized for Bun runtime.
6
6
 
7
+ <img width="2624" height="1320" alt="carbon" src="https://github.com/user-attachments/assets/41cccd6a-f029-4206-b3bc-a85c5dbcf2cf" />
8
+
7
9
  ## Features
8
10
 
9
11
  - 🐚 **Shell-like by Default**: Commands behave exactly like running in terminal (stdoutβ†’stdout, stderrβ†’stderr, stdinβ†’stdin)
@@ -16,6 +18,46 @@ A modern $ shell utility library with streaming, async iteration, and EventEmitt
16
18
  - πŸ›‘οΈ **Type Safe**: Full TypeScript support (coming soon)
17
19
  - πŸ”§ **Built-in Commands**: 18 essential commands work identically across platforms
18
20
 
21
+ ## Comparison with Other Libraries
22
+
23
+ | Feature | [command-stream](https://github.com/link-foundation/command-stream) | [Bun.$](https://bun.sh/docs/runtime/shell) | [execa](https://github.com/sindresorhus/execa) | [zx](https://github.com/google/zx) |
24
+ |---------|----------------|-------|-------|-----|
25
+ | **Runtime Support** | βœ… Bun + Node.js | 🟑 Bun only | βœ… Node.js | βœ… Node.js |
26
+ | **Template Literals** | βœ… `` $`cmd` `` | βœ… `` $`cmd` `` | βœ… `` $`cmd` `` | βœ… `` $`cmd` `` |
27
+ | **Real-time Streaming** | βœ… Live output | ❌ Buffer only | 🟑 Limited | ❌ Buffer only |
28
+ | **Synchronous Execution** | βœ… `.sync()` with events | ❌ No | βœ… `execaSync` | ❌ No |
29
+ | **Async Iteration** | βœ… `for await (chunk of $.stream())` | ❌ No | ❌ No | ❌ No |
30
+ | **EventEmitter Pattern** | βœ… `.on('data', ...)` | ❌ No | 🟑 Limited events | ❌ No |
31
+ | **Mixed Patterns** | βœ… Events + await/sync | ❌ No | ❌ No | ❌ No |
32
+ | **Shell Injection Protection** | βœ… Auto-quoting | βœ… Built-in | βœ… Safe by default | βœ… Safe by default |
33
+ | **Cross-platform** | βœ… macOS/Linux/Windows | βœ… Yes | βœ… Yes | βœ… Yes |
34
+ | **Performance** | ⚑ Fast (Bun optimized) | ⚑ Very fast | 🐌 Moderate | 🐌 Slow |
35
+ | **Memory Efficiency** | βœ… Streaming prevents buildup | 🟑 Buffers in memory | 🟑 Buffers in memory | 🟑 Buffers in memory |
36
+ | **Error Handling** | βœ… Configurable (`set -e`/`set +e`, non-zero OK by default) | βœ… Throws on error | βœ… Throws on error | βœ… Throws on error |
37
+ | **Shell Settings** | βœ… `set -e`/`set +e` equivalent | ❌ No | ❌ No | ❌ No |
38
+ | **Stdout Support** | βœ… Real-time streaming + events | βœ… Shell redirection + buffered | βœ… Node.js streams + interleaved | βœ… Readable streams + `.pipe.stdout` |
39
+ | **Stderr Support** | βœ… Real-time streaming + events | βœ… Redirection + `.quiet()` access | βœ… Streams + interleaved output | βœ… Readable streams + `.pipe.stderr` |
40
+ | **Stdin Support** | βœ… string/Buffer/inherit/ignore | βœ… Pipe operations | βœ… Input/output streams | βœ… Basic stdin |
41
+ | **Built-in Commands** | βœ… **18 commands**: cat, ls, mkdir, rm, mv, cp, touch, basename, dirname, seq, yes + all Bun.$ commands | βœ… echo, cd, etc. | ❌ Uses system | ❌ Uses system |
42
+ | **Virtual Commands Engine** | βœ… **Revolutionary**: Register JavaScript functions as shell commands with full pipeline support | ❌ No extensibility | ❌ No custom commands | ❌ No custom commands |
43
+ | **Pipeline/Piping Support** | βœ… **Advanced**: System + Built-ins + Virtual + Mixed + `.pipe()` method | βœ… Standard shell piping | βœ… Programmatic `.pipe()` + multi-destination | βœ… Shell piping + `.pipe()` method |
44
+ | **Bundle Size** | πŸ“¦ ~15KB | 🎯 0KB (built-in) | πŸ“¦ ~25KB | πŸ“¦ ~50KB |
45
+ | **TypeScript** | πŸ”„ Coming soon | βœ… Built-in | βœ… Full support | βœ… Full support |
46
+ | **License** | βœ… **Unlicense (Public Domain)** | 🟑 MIT (+ LGPL dependencies) | 🟑 MIT | 🟑 Apache 2.0 |
47
+
48
+ ### Why Choose command-stream?
49
+
50
+ - **πŸ†“ Truly Free**: **Unlicense (Public Domain)** - No restrictions, no attribution required, use however you want
51
+ - **πŸš€ Revolutionary Virtual Commands**: **World's first** fully customizable virtual commands engine - register JavaScript functions as shell commands!
52
+ - **πŸ”— Advanced Pipeline System**: **Only library** where virtual commands work seamlessly in pipelines with built-ins and system commands
53
+ - **πŸ”§ Built-in Commands**: **18 essential commands** work identically across all platforms - no system dependencies!
54
+ - **πŸ“‘ Real-time Processing**: Only library with true streaming and async iteration
55
+ - **πŸ”„ Flexible Patterns**: Multiple usage patterns (await, events, iteration, mixed)
56
+ - **🐚 Shell Replacement**: Dynamic error handling with `set -e`/`set +e` equivalents for .sh file replacement
57
+ - **⚑ Bun Optimized**: Designed for Bun with Node.js fallback compatibility
58
+ - **πŸ’Ύ Memory Efficient**: Streaming prevents large buffer accumulation
59
+ - **πŸ›‘οΈ Production Ready**: 266+ tests with comprehensive coverage
60
+
19
61
  ## Built-in Commands (πŸš€ NEW!)
20
62
 
21
63
  command-stream now includes **18 built-in commands** that work identically to their bash/sh counterparts, providing true cross-platform shell scripting without system dependencies:
@@ -72,46 +114,6 @@ await $`seq 1 5 | cat > numbers.txt`;
72
114
  await $`basename /path/to/file.txt .txt`; // β†’ "file"
73
115
  ```
74
116
 
75
- ## Comparison with Other Libraries
76
-
77
- | Feature | [command-stream](https://github.com/link-foundation/command-stream) | [Bun.$](https://bun.sh/docs/runtime/shell) | [execa](https://github.com/sindresorhus/execa) | [zx](https://github.com/google/zx) |
78
- |---------|----------------|-------|-------|-----|
79
- | **Runtime Support** | βœ… Bun + Node.js | 🟑 Bun only | βœ… Node.js | βœ… Node.js |
80
- | **Template Literals** | βœ… `` $`cmd` `` | βœ… `` $`cmd` `` | βœ… `` $`cmd` `` | βœ… `` $`cmd` `` |
81
- | **Real-time Streaming** | βœ… Live output | ❌ Buffer only | 🟑 Limited | ❌ Buffer only |
82
- | **Synchronous Execution** | βœ… `.sync()` with events | ❌ No | βœ… `execaSync` | ❌ No |
83
- | **Async Iteration** | βœ… `for await (chunk of $.stream())` | ❌ No | ❌ No | ❌ No |
84
- | **EventEmitter Pattern** | βœ… `.on('data', ...)` | ❌ No | 🟑 Limited events | ❌ No |
85
- | **Mixed Patterns** | βœ… Events + await/sync | ❌ No | ❌ No | ❌ No |
86
- | **Shell Injection Protection** | βœ… Auto-quoting | βœ… Built-in | βœ… Safe by default | βœ… Safe by default |
87
- | **Cross-platform** | βœ… macOS/Linux/Windows | βœ… Yes | βœ… Yes | βœ… Yes |
88
- | **Performance** | ⚑ Fast (Bun optimized) | ⚑ Very fast | 🐌 Moderate | 🐌 Slow |
89
- | **Memory Efficiency** | βœ… Streaming prevents buildup | 🟑 Buffers in memory | 🟑 Buffers in memory | 🟑 Buffers in memory |
90
- | **Error Handling** | βœ… Configurable (`set -e`/`set +e`, non-zero OK by default) | βœ… Throws on error | βœ… Throws on error | βœ… Throws on error |
91
- | **Shell Settings** | βœ… `set -e`/`set +e` equivalent | ❌ No | ❌ No | ❌ No |
92
- | **Stdout Support** | βœ… Real-time streaming + events | βœ… Shell redirection + buffered | βœ… Node.js streams + interleaved | βœ… Readable streams + `.pipe.stdout` |
93
- | **Stderr Support** | βœ… Real-time streaming + events | βœ… Redirection + `.quiet()` access | βœ… Streams + interleaved output | βœ… Readable streams + `.pipe.stderr` |
94
- | **Stdin Support** | βœ… string/Buffer/inherit/ignore | βœ… Pipe operations | βœ… Input/output streams | βœ… Basic stdin |
95
- | **Built-in Commands** | βœ… **18 commands**: cat, ls, mkdir, rm, mv, cp, touch, basename, dirname, seq, yes + all Bun.$ commands | βœ… echo, cd, etc. | ❌ Uses system | ❌ Uses system |
96
- | **Virtual Commands Engine** | βœ… **Revolutionary**: Register JavaScript functions as shell commands with full pipeline support | ❌ No extensibility | ❌ No custom commands | ❌ No custom commands |
97
- | **Pipeline/Piping Support** | βœ… **Advanced**: System + Built-ins + Virtual + Mixed + `.pipe()` method | βœ… Standard shell piping | βœ… Programmatic `.pipe()` + multi-destination | βœ… Shell piping + `.pipe()` method |
98
- | **Bundle Size** | πŸ“¦ ~15KB | 🎯 0KB (built-in) | πŸ“¦ ~25KB | πŸ“¦ ~50KB |
99
- | **TypeScript** | πŸ”„ Coming soon | βœ… Built-in | βœ… Full support | βœ… Full support |
100
- | **License** | βœ… **Unlicense (Public Domain)** | 🟑 MIT (+ LGPL dependencies) | 🟑 MIT | 🟑 Apache 2.0 |
101
-
102
- ### Why Choose command-stream?
103
-
104
- - **πŸ†“ Truly Free**: **Unlicense (Public Domain)** - No restrictions, no attribution required, use however you want
105
- - **πŸš€ Revolutionary Virtual Commands**: **World's first** fully customizable virtual commands engine - register JavaScript functions as shell commands!
106
- - **πŸ”— Advanced Pipeline System**: **Only library** where virtual commands work seamlessly in pipelines with built-ins and system commands
107
- - **πŸ”§ Built-in Commands**: **18 essential commands** work identically across all platforms - no system dependencies!
108
- - **πŸ“‘ Real-time Processing**: Only library with true streaming and async iteration
109
- - **πŸ”„ Flexible Patterns**: Multiple usage patterns (await, events, iteration, mixed)
110
- - **🐚 Shell Replacement**: Dynamic error handling with `set -e`/`set +e` equivalents for .sh file replacement
111
- - **⚑ Bun Optimized**: Designed for Bun with Node.js fallback compatibility
112
- - **πŸ’Ύ Memory Efficient**: Streaming prevents large buffer accumulation
113
- - **πŸ›‘οΈ Production Ready**: 266+ tests with comprehensive coverage
114
-
115
117
  ## Installation
116
118
 
117
119
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "command-stream",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
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",