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)
    

    Keywords

    none

    Install

    npm i normalize-pathname

    DownloadsWeekly Downloads

    56

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • jonpacker