Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Deno.emit

UNSTABLE: new API, yet to be vetted.

Similar to the command line functionality of deno run or deno cache, Deno.emit() provides a way to provide Deno arbitrary JavaScript or TypeScript and have it return JavaScript based on the options and settings provided. The source code can either be provided or the modules can be fetched and resolved in line with the behavior of the command line.

Requires allow-read and/or allow-net if sources are not provided.

function emit(rootSpecifier: string | URL, options?: EmitOptions): Promise<EmitResult>;
§
emit(rootSpecifier: string | URL, options?: EmitOptions): Promise<EmitResult>
[src]

§Parameters

§
rootSpecifier: string | URL
[src]

The specifier that will be used as the entry point. If no sources are provided, then the specifier would be the same as if you typed it on the command line for deno run. If sources are provided, it should match one of the names of the sources.

§
options?: EmitOptions optional
[src]

A set of options to be used with the emit.

§Return Type

§

The result of the emit. If diagnostics are found, they can be used with Deno.formatDiagnostics to construct a user friendly string, which has the same format as CLI diagnostics.