@mbartoldus/stringworker@0.1.1
latest
makes a worker from a given script string
This package works with Deno, BrowsersIt is unknown whether this package works with Cloudflare Workers, Node.js, Bun




JSR Score
100%
Published
a year ago (0.1.1)
import { escapeScript } from './escapeScript.ts' /** * Converts a script, representated as a string, to a script which exports that script as a string. * @example * const script = bakeScript('console.log("hello world")') * // returns `export default \`bakeScript('console.log("hello world")')\`` */ export function bakeScript(script: string): string { return `export default \`${escapeScript(script)}\`` }