Skip to main content

classify

Function classify 

Source
pub fn classify(specifier: &str) -> Origin
Expand description

Classify a module specifier as first-party, Node-builtin, or third-party.

Deterministic and resolution-free — the bright-line rule the README’s isolation checks rest on:

  • a relative or absolute path (./, ../, /) is first-party;
  • a node:-prefixed specifier, or one whose first path segment is a known Node built-in (so fs and fs/promises both match), is a built-in;
  • every other (bare) specifier is a third-party package.