doc: Label the origin of the converted moo.js file

Resolves #1.
This commit is contained in:
Glen Whitney 2023-09-01 14:29:38 -07:00
parent 77bd983cbc
commit 80552e6519

View File

@ -1,7 +1,9 @@
import {stdin, argv} from 'node:process'
import {streamToString} from '../etc/streamToString.js'
const preamble = 'export default (((f) => f())(function () {'
const preamble = `// ES6 Module converted from https://github.com/no-context/moo
export default (((f) => f())(function () {
`
const umd = await streamToString(stdin)
const realStart = umd.indexOf(" 'use strict'")
console.log(preamble + "\n" + umd.substring(realStart))
console.log(preamble + umd.substring(realStart))