parent
59aeaaee7d
commit
f1f1aebd81
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import {readFile} from 'node:fs/promises';
|
||||
import { gronReadStream } from './ngronstream.mjs';
|
||||
|
||||
const main = async (args) => {
|
||||
if (args.length === 0) {
|
||||
process.stderr.write(`Usage: ngron [filename]\n`);
|
||||
process.exit(1);
|
||||
}
|
||||
const content = await readFile(args[0], {encoding: 'utf8'});
|
||||
const json = JSON.parse(content);
|
||||
gronReadStream(json).pipe(process.stdout);
|
||||
|
||||
}
|
||||
|
||||
main(process.argv.slice(2));
|
Loading…
Reference in new issue