Dev Helpers
← Back

Resolve an ES module specifier

Resolve an ES module specifier using Node.js.

Open this example in the interactive library

Source code

import {
  builtinModules,
  isBuiltin,
  createRequire,
  syncBuiltinESMExports,
} from "node:module";
import { pathToFileURL } from "node:url";
console.log(import.meta.resolve("node:events"));

Sample output

node:events