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

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

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

Concatenates all given segments into a well-formed path.

Examples

Example 1

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

console.log(join("foo", "bar")); // "foo/bar" or "foo\\bar" on Windows
console.log(join("/", "foo", "bar")); // "/foo/bar"
console.log(join("C:\\", "foo", "bar")); // "C:\\foo\\bar"
console.log(join("file:///foo", "bar", "..")) // "file:///foo"

console.log(join("http://example.com", "foo", "bar", "?query"));
// "http://example.com/foo/bar?query"

Parameters

...segments