0.0.5 • Published 1 year ago

url-component-join v0.0.5

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
1 year ago

URL Component Join

normalize and join url components

Installation

npm install --save url-component-join

Functions

normalize(path: string): string

Normalizes the given path, remove redundant / and resolving .. and . segments.

import { normalize } from 'url-component-join';

normalize('//a/a/..//b.c');
// /a/b.c

join(...paths: Array<string>): string

Normalize and join several segments into one path

import { join } from 'url-component-join';

join('//a/a/', '..', '//b.c');
// /a/b.c

join('http://127.0.0.1:8080/a//b', '//c///d')
// http://127.0.0.1:8080/a/b/c/d

join('http://127.0.0.1:8080/a//b', 'http://127.0.0.1:8080//c///d')
// http://127.0.0.1:8080/a/b/c/d

basename(path: string): string

dirname(path: string): string

relative(from: string, to: string): string

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago