import { default } from "https://deno.land/std@0.36.0/node/module.ts";
Static Methods
_findPath(): string | boolean
request: string,
paths: string[],
isMain: boolean,
_initPaths(): void
_load(): any
request: string,
parent: Module,
isMain: boolean,
_nodeModulePaths(from: string): string[]
_preloadModules(requests: string[]): void
_resolveFilename(): string
request: string,
parent: Module,
isMain: boolean,
options?: { paths: string[]; },
_resolveLookupPaths(request: string, parent: Module | null): string[] | null
createRequire(filename: string | URL): RequireFunction
Create a require
function that can be used to import CJS modules.
Follows CommonJS resolution similar to that of Node.js,
with node_modules
lookup and index.js
lookup support.
Also injects available Node.js builtin module polyfills.
const require_ = createRequire(import.meta.url);
const fs = require_("fs");
const leftPad = require_("left-pad");
const cjsModule = require_("./cjs_mod");
wrap(script: string): string