Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/enzastdlib/vendor/@deno-emit.ts

enzastdlib is a set of TypeScript modules that follow a common design API philosophy aiming at sane defaults and ease-of-use targeting the Deno TypeScript runtime.
Latest
import * as enzastdlib from "https://deno.land/x/enzastdlib@v0.0.4/vendor/@deno-emit.ts";

APIs to transpile and bundle JavaScript and TypeScript under Deno and Deno.

It is a user loadable module which provides an alternative to the removed unstable Deno.emit() API.

Example - Transpiling

import { transpile } from "https://deno.land/x/emit/mod.ts";

const url = new URL("./testdata/mod.ts", import.meta.url);
const result = await transpile(url.href);

const { code } = result;
console.log(code.includes("export default function hello()"));

Example - Bundling

import { bundle } from "https://deno.land/x/emit/mod.ts";
const result = await bundle(
  "https://deno.land/std@0.140.0/examples/chat/server.ts",
);

const { code } = result;
console.log(code);

Functions

Generate a single file JavaScript bundle of the root module and its dependencies.

Transpile TypeScript (or JavaScript) into JavaScript, returning a promise which resolves with a map of the emitted files.

Interfaces

The output of the bundle function.

Options which can be set when using the transpile function.