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
npm i redstd
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);MIT