Nodes Per Minute

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

    2.0.1 • Public • Published

    Is URL External?

    A simple function that tells you whether an URL is external or not.

    Usage

    import { isUrlExternal } from "./index";
    
    isUrlExternal('https://github.com/mrded/is-url-external', 'github.com'); // false 
    
    const isExternal = (url: string) => isUrlExternal(url, window.location.hostname);
    isExternal('https://github.com/mrded/is-url-external'); // true | false

    Install

    npm i is-url-external

    DownloadsWeekly Downloads

    1,356

    Version

    2.0.1

    License

    WTFPL

    Unpacked Size

    3.31 kB

    Total Files

    7

    Last publish

    Collaborators

    • mrded