Dev Helpers

Node.js / Runtime modules

Identify a built-in module

Dev Helpers · March 4, 2026

Built-in module detection distinguishes runtime modules from similarly named packages. That distinction matters when reporting dependencies.

Worked example

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

Result

true

Implementation notes

The node: prefix makes an intended runtime dependency explicit in source. Normalize names consistently when comparing imports in a report.

Try it yourself

Compare a built-in specifier with a project-relative module path.

Open the Node.js example →

Editorial date March 4, 2026 · Published December 6, 2026

Related articles

Safely parse malformed input

Parsing user-provided JSON needs a failure path. Successful parsing alone does not establish that the result has the expected shape.

Checksum bytes with CRC32

CRC32 is useful for detecting accidental changes to a byte sequence. Record the input encoding so different producers compute the same checksum.

Attach details to a mark

Performance marks can carry details about the operation they describe. Small stable identifiers are easier to aggregate than large payloads.