From 80552e6519f88811a90c4a06a2f7415249717fca Mon Sep 17 00:00:00 2001 From: Glen Whitney Date: Fri, 1 Sep 2023 14:29:38 -0700 Subject: [PATCH] doc: Label the origin of the converted moo.js file Resolves #1. --- tools/modulize.mjs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/modulize.mjs b/tools/modulize.mjs index 6746e2b..1549445 100644 --- a/tools/modulize.mjs +++ b/tools/modulize.mjs @@ -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))