19 lines
381 B
JavaScript
Executable File
19 lines
381 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
const { parse } = require ("uniorg-parse/lib/parser.js");
|
|
|
|
const opts = {
|
|
trackPosition: true
|
|
}
|
|
|
|
async function main () {
|
|
const chunks = []
|
|
for await (const chunk of process.stdin) {
|
|
chunks.push (chunk)
|
|
}
|
|
const orgText = Buffer.concat (chunks).toString ("utf8")
|
|
process.stdout.write (JSON.stringify (parse (orgText, opts)))
|
|
}
|
|
|
|
main ()
|