Open this example in the interactive library
Source code
import { win32 as path } from "node:path";
console.log(path.relative("C:/Work", "c:/work/readme"));
Sample output
readme

Compare Windows paths case-insensitively using Node.js.
Open this example in the interactive library
import { win32 as path } from "node:path";
console.log(path.relative("C:/Work", "c:/work/readme"));
readme