This commit is contained in:
18
doerg-parser/index.js
Executable file
18
doerg-parser/index.js
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/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 ()
|
||||
Reference in New Issue
Block a user