Nucleus Powered Mitochondria

    @cityssm/is-private-network-address
    TypeScript icon, indicating that this package has built-in type declarations

    0.2.1 • Public • Published

    is-private-network-address

    npm (scoped) Codacy grade Code Climate maintainability Code Climate coverage AppVeyor Snyk Vulnerabilities for GitHub Repo

    Determines whether or not a network address is a private or internal.

    Supports all Reserved IP Addresses used for private networks.

    Installation

    npm install @cityssm/is-private-network-address

    Usage

    import { isLocal, isPrivate } from "@cityssm/is-private-network-address";
    
    /* Test Local IPs */
    
    console.log(isLocal("127.0.0.1"));
    // => true
    
    console.log(isLocal("::1"));
    // => true
    
    console.log(isLocal("12.34.56.78"));
    // => false
    
    /* Test Private IPs */
    
    console.log(isPrivate("10.0.100.100"));
    // => true
    
    console.log(isPrivate("192.168.2.1"));
    // => true

    Install

    npm i @cityssm/is-private-network-address

    DownloadsWeekly Downloads

    0

    Version

    0.2.1

    License

    MIT

    Unpacked Size

    6.49 kB

    Total Files

    6

    Last publish

    Collaborators

    • dgowans