Read from a file, falling back to stdin.
$ npm install read-file-stdin
Read from a file
, falling back to stdin, and callback(err, buffer)
.
MIT
Read from a file, falling back to stdin.
I like to announce a message like "I: now reading from stdin." when my programs are ready to read from stdin and it is a TTY, so in case of accidential missing filename, users never think the program hangs, but instead immediately see that their invocation went wrong.
Could you add an option stdinTtyHint
that can accept a string to be printed to stderr, or a function to be called as soon as the pipe is set up?
An options object could be passed in the first slot instead of a filename, and the filename taken from the filename
option. If you like the idea, I could make a PR for it.
The package is pretty big because it includes the 'test' directory, this has been fixed but never got published to NPM. Could you publish it?
While you are publishing it would be a good idea to bump the version to 1.0.0 since this package isn't in any kind of experimental state.
Add please test
to npm ignore
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.