Skip to main content

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
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
This package works with Browsers
JSR Score
100%
Published
3 months ago (0.1.1)
function bakeScript
bakeScript(script: string): string

Converts a script, representated as a string, to a script which exports that script as a string.

Examples

Example 1

const script = bakeScript('console.log("hello world")') // returns export default \bakeScript('console.log("hello world")')``

Parameters

script: string

Return Type

Add Package

deno add jsr:@mbartoldus/stringworker

Import symbol

import { bakeScript } from "@mbartoldus/stringworker";

---- OR ----

Import directly with a jsr specifier

import { bakeScript } from "jsr:@mbartoldus/stringworker";

Add Package

npx jsr add @mbartoldus/stringworker

Import symbol

import { bakeScript } from "@mbartoldus/stringworker";

Add Package

yarn dlx jsr add @mbartoldus/stringworker

Import symbol

import { bakeScript } from "@mbartoldus/stringworker";

Add Package

pnpm dlx jsr add @mbartoldus/stringworker

Import symbol

import { bakeScript } from "@mbartoldus/stringworker";

Add Package

bunx jsr add @mbartoldus/stringworker

Import symbol

import { bakeScript } from "@mbartoldus/stringworker";