phadej / relaxed-json

Relaxed JSON is strict superset JSON, relaxing strictness of vanilla JSON
http://oleg.fi/relaxed-json/
Other
80 stars 8 forks source link

ER: read from STDIN #19

Open pkoppstein opened 6 years ago

pkoppstein commented 6 years ago

A simple way to support reading from STDIN would be to replace the "var contents" line in rjson.js by:

const fd =  (program.args[0] === "-") ? process.stdin.fd : program.args[0];
var contents = fs.readFileSync(fd).toString();

This allows "-" to be specified on the command-line.