Wondering what’s next for npm?Check out our public roadmap! »

    is-relative-url
    TypeScript icon, indicating that this package has built-in type declarations

    3.0.0 • Public • Published

    is-relative-url Build Status

    Check if an URL is relative

    Install

    $ npm install is-relative-url
    

    Usage

    const isRelativeUrl = require('is-relative-url');
     
    isRelativeUrl('foo/bar');
    //=> true
     
    isRelativeUrl('https://sindresorhus.com/foo/bar');
    //=> false
     
    isRelativeUrl('//sindresorhus.com');
    //=> true

    Related

    See is-absolute-url for the inverse.

    License

    MIT © Sindre Sorhus

    Install

    npm i is-relative-url

    DownloadsWeekly Downloads

    453,657

    Version

    3.0.0

    License

    MIT

    Unpacked Size

    2.83 kB

    Total Files

    5

    Last publish

    Collaborators

    • avatar