normalize-pathname

1.0.1 • Public • Published

normalize-pathname

Normalizes any pathname to the same format: one leading slash, no trailing slash.

install

npm install normalize-pathname

usage

var normalizePathname = require('normalize-pathname');
console.log(normalizePathname('wibblebong/wollomombi/'));
// -> '/wibblebong/wollomombi'

examples

/one/two/ -> /one/two
one/two   -> /one/two
one/two/  -> /one/two
one       -> /one
/one/     -> /one
one/      -> /one
/         -> (empty string)

/normalize-pathname/

    Package Sidebar

    Install

    npm i normalize-pathname

    Weekly Downloads

    62

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • jonpacker