import { default } from "https://dotland.deno.dev/std@0.177.0/node/module.ts";
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.
import { createRequire } from "https://deno.land/std@0.177.0/node/module.ts";
const require = createRequire(import.meta.url);
const fs = require("fs");
const leftPad = require("left-pad");
const cjsModule = require("./cjs_mod");