Last updated

file-path and URL parsing. Parse-only in v1. Absent options stay absent.

const path = require("std/path");console.log(path.parse("/a/b/c.txt").ext); // "txt"console.log(path.parse("/a/b/c.txt").segments); // ["a", "b", "c.txt"]const web = path.parse("https://user@host:8080/p?q=1#frag");console.log(web.host + web.path); // "host/p"

🔗path.parse

path.parse(text) -> local or network path object

const path = require("std/path");path.parse("example");