feat: install moo and use in toy example #2

Merged
glen merged 2 commits from install_moo into main 2023-09-01 21:32:25 +00:00
Showing only changes of commit 80552e6519 - Show all commits

View File

@ -1,7 +1,9 @@
import {stdin, argv} from 'node:process' import {stdin, argv} from 'node:process'
import {streamToString} from '../etc/streamToString.js' 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 umd = await streamToString(stdin)
const realStart = umd.indexOf(" 'use strict'") const realStart = umd.indexOf(" 'use strict'")
console.log(preamble + "\n" + umd.substring(realStart)) console.log(preamble + umd.substring(realStart))