redstd
read stin
Last updated 7 months ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install redstd 
SYNC missed versions from official npm registry.

redstd License NPM version Build Status Coverage Status

Read stdin to have ability to use pipes like: cat README.md | less or

cat README.md | node -e "const {readStdin} = await import('redstd'); console.log(await readStdin())"

When you pass nothing to stdin - everything just works, so you can read from stdout or from file

Install

npm i redstd

Usage

import {readFile} from 'node:fs/promises';
import {readStdin} from 'redstd';

const input = await readStdin();

if (!input) {
    console.log(await readFile('./README.md'));
    process.exit();
}

console.log(input);

License

MIT

Current Tags

  • 1.0.2                                ...           latest (7 months ago)

3 Versions

  • 1.0.2                                ...           7 months ago
  • 1.0.1                                ...           7 months ago
  • 1.0.0                                ...           7 months ago
Maintainers (1)
Downloads
Total 12
Today 0
This Week 0
This Month 3
Last Day 0
Last Week 0
Last Month 9
Dependencies (0)
None
Dev Dependencies (9)
Dependents (3)

© 2010 - cnpmjs.org x YWFE | Home | YWFE