Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/esm/path/index.js>split

A JavaScript extension package for building strong and modern applications.
Latest
function split
import { split } from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/path/index.js";

Splits the path into well-formed segments.

Examples

Example 1

import { split } from "@ayonli/jsext/path";

console.log(split("/usr/bin")); // ["/", "usr", "bin"]
console.log(split("C:\\Windows\\System32")); // ["C:\\", "Windows", "System32"]
console.log(split("file:///user/bin")); // ["file:///", "usr", "bin"]

console.log(split("http://example.com/foo/bar?foo=bar#baz"));
// ["http://example.com", "foo", "bar", "?foo=bar", "#baz"]