file URL

A URL starting with file:// that points at a file on the local disk; Node.js identifies ES modules by these.

In more detail

fileURLToPath() from node:url turns one into an ordinary path for the current platform, and pathToFileURL() does the reverse. Using URLs lets the same module specifiers work in browsers and servers.

Related terms

Taught in

References