UNPKG

stdinfile

Version:

`await file('').json(); await stdin().json()`; utilities for reading and writing files, as well as reading from stdin.

26 lines (17 loc) 545 B
# 1stream > 🚀 A set of utilities for reading and writing files, as well as reading from stdin. > Inspired by `Bun.file()` and `Bun.stdin()`. ``` npm install 1stream ``` ```js import * as stream from 'stdinfile'; const data: Yours = await stream.file('abc.json').json(); const data2: string = await stream.file('abc.json').text(); const stdin: Yours = await stream.stdin().json(); // OR const stdin2: string = await stream.stdin().text(); await stream.write('output.json', data2); ``` # LICENSE New BSD License ©Ninh Pham - ReeganExE