`path` builds and inspects file paths without hard-coding `/` or `\\`, which differ between POSIX and Windows.
js
import path from "node:path";
const full = path.join(__dirname, "data", "chains.json");
console.log(path.extname(full)); // ".json"
console.log(path.basename(full)); // "chains.json"
console.log(path.resolve("./config")); // absolute path from cwd`path.join` also normalizes redundant separators and `..` segments, which matters when paths are assembled from multiple config values — using string concatenation instead is a common source of subtle cross-platform bugs.