node-stream-io
v0.1.0
Published
A Node.js package for seamless input/output stream redirection and handling from the command line. Easily route input to standard input, output to standard output, and errors to standard error using intuitive tokens. Perfect for interacting with files, p
Downloads
3
Readme
StreamIO
StreamIO.js is a lightweight Node.js package that simplifies input/output stream redirection and handling from the command line.
Installation
You can install StreamIO.js using npm:
npm install stream-io
Usage
StreamIO.js provides a simple and intuitive way to manage input and output streams from the command line.
Basic Usage
node index.js -- # Output: Whatever you type followed by Enter
node index.js - # Input: Type something and press Enter
node index.js --- # Error: Whatever you type followed by Enter
Redirecting Input
You can redirect input from a file using the <
operator:
node index.js -- < input.txt
Redirecting Output
You can redirect the output to a file using the >
operator:
node index.js -- > output.txt
Piping Output
You can also pipe the output to another command using the |
operator:
node index.js -- | wc -l
Combining Redirection and Piping
Combine redirection and piping as needed:
node index.js -- > output.txt | wc -l
Contributing
Contributions are welcome! If you find any issues or have suggestions, please open an issue or submit a pull request.
License
This project is licensed under the MIT License.