• Normalize a URL.

    URLs with custom protocols are not normalized and just passed through by default. Supported protocols are: https, http, file, and data.

    Parameters

    • urlString: string
    • Optionalopts: Options

    Returns string

    import normalizeUrl from 'normalize-url';

    normalizeUrl('sindresorhus.com');
    //=> 'http://sindresorhus.com'

    normalizeUrl('//www.sindresorhus.com:80/../baz?b=bar&a=foo');
    //=> 'http://sindresorhus.com/baz?a=foo&b=bar'