@robinpath/stream
v0.1.0
Published
> Stream processing for large files: read, write, transform, filter, split, concat, hash without loading into memory
Keywords
Readme
@robinpath/stream
Stream processing for large files: read, write, transform, filter, split, concat, hash without loading into memory
Why use this module?
The stream module lets you:
- Read entire file content
- Write data to file
- Stream-copy a file
- Read file line by line into array
- Transform file line by line
All functions are callable directly from RobinPath scripts with a simple, consistent API.
Installation
npm install @robinpath/streamQuick Start
No credentials needed — start using it right away:
stream.writeFile "./out.txt" "hello"Available Functions
| Function | Description |
|----------|-------------|
| stream.readFile | Read entire file content |
| stream.writeFile | Write data to file |
| stream.copyFile | Stream-copy a file |
| stream.lines | Read file line by line into array |
| stream.transform | Transform file line by line |
| stream.filter | Filter file lines by regex pattern |
| stream.concat | Concatenate multiple files |
| stream.split | Split file into chunks |
| stream.count | Count lines in file |
| stream.head | Read first N lines |
| stream.tail | Read last N lines |
| stream.pipe | Download URL to file via stream |
| stream.hash | Stream-hash a file |
Examples
Write data to file
stream.writeFile "./out.txt" "hello"Stream-copy a file
stream.copyFile "./a.txt" "./b.txt"Read file line by line into array
stream.lines "./data.csv"Integration with RobinPath
import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/stream";
const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);
const result = await rp.executeScript(`
stream.writeFile "./out.txt" "hello"
`);Full API Reference
See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.
Related Modules
@robinpath/json— JSON module for complementary functionality
License
MIT
