We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c3eee6c commit e7be945Copy full SHA for e7be945
json-to-go.js
@@ -459,6 +459,10 @@ if (typeof module != 'undefined') {
459
const json = Buffer.concat(bufs).toString('utf8')
460
process.stdout.write(jsonToGo(json).go)
461
})
462
+ } else if (process.argv.length === 3) {
463
+ const fs = require('node:fs');
464
+ const json = fs.readFileSync(process.argv[2], 'utf8');
465
+ console.log(jsonToGo(json).go)
466
} else {
467
process.stdin.on('data', function(buf) {
468
const json = buf.toString('utf8')
0 commit comments