redstd

read stin

MIT 3 个版本
安装
npm install redstd
yarn add redstd
pnpm add redstd
bun add redstd
README

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

版本列表
1.0.2 2026-04-15
1.0.1 2026-04-15
1.0.0 2026-04-15