Normalizing dot segments simplifies the spelling of a path. It does not establish that the target exists or resolve symbolic links.
Worked example
import { posix as path } from "node:path";
console.log(path.normalize("/app/tmp/../config/"));Result
/app/config/Implementation notes
Equivalent-looking normalized strings can refer to different filesystem objects through symlinks. Use the correct filesystem operation when identity matters.
Try it yourself
Normalize a path containing a nonexistent intermediate directory.
Open the Node.js example →Editorial date April 14, 2026 · Published December 6, 2026