Skip to main content
Module

x/enzastdlib/realm/mod.ts>makeRealm

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
function makeRealm
import { makeRealm } from "https://deno.land/x/enzastdlib@v0.0.4/realm/mod.ts";

Creates a new custom JavaScript / TypeScript execution environment.

Examples

myscript.js

export const message = `Hello ${name}!`;

mod.ts

import { makeRealm } from 'https://deno.land/x/enzastdlib/realm/mod.ts';

const realm = makeRealm({
    environment: {
        globalThis: {
            name: 'World',
        },
    },
});

const {message} = realm.importModule('./myscript.js');

Type Parameters

optional
GlobalThisType = unknown

Parameters

optional
options: RealmOptions<GlobalThisType> = [UNSUPPORTED]