This release is 1 version behind 0.1.15 — the latest version of @classic/js. Jump to latest
Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
Works with
•JSR Score94%•This package works with DenoIt is unknown whether this package works with Cloudflare Workers, Node.js, Bun, Browsers




Published6 months ago (0.1.14)
Ad hoc (client) JavaScript from typed (server) code
Generate typed JS on the fly.
Keeps track of manipulated references, outputs compact code.
Provide time in target platform
Provide time in target platform
import { js } from "@classic/js"; const now = js<Date>`new Date()`; const time = js.string`Time is ${now.getHours()}:${now.getMinutes()}`; // Generated code looks like: // let now = new Date(); // let time = `Time is ${now.getHours()}:${now.getMinutes()}`;
Render a react app
Render a react app
import { js, type JS } from "@classic/js"; import type React from "npm:react"; import type { Root } from "npm:react-dom/client"; const react = js.module<typeof import("npm:react-dom/client")>("npm:react-dom/client"); const app = js.module<{ render: (root: Root) => void }>(import.meta.resolve("./app.tsx")); const clientJs = app.render(react.createRoot(js.window.document.body));
Built and signed on
GitHub Actions
Add Package
deno add jsr:@classic/js
Import symbol
import * as js from "@classic/js";
Import directly with a jsr specifier
import * as js from "jsr:@classic/js";
Add Package
pnpm i jsr:@classic/js
pnpm dlx jsr add @classic/js
Import symbol
import * as js from "@classic/js";
Add Package
yarn add jsr:@classic/js
yarn dlx jsr add @classic/js
Import symbol
import * as js from "@classic/js";
Add Package
vlt install jsr:@classic/js
Import symbol
import * as js from "@classic/js";
Add Package
npx jsr add @classic/js
Import symbol
import * as js from "@classic/js";
Add Package
bunx jsr add @classic/js
Import symbol
import * as js from "@classic/js";