sync-is-private-host

1.0.0 • Public • Published

sync-is-private-host

Synchronously determine if a host is private (a.k.a. not publicly available). Works with hostnames and IPv4 addresses.

Please create an issue if you encounter false-positive or false-negative results. Thanks.

Installation

npm install sync-is-private-host

Usage

const syncIsPrivateHost = require('sync-is-private-host')

syncIsPrivateHost.isPrivate('localhost')
// true
syncIsPrivateHost.isPrivate('10.0.0.1')
// true
syncIsPrivateHost.isPrivate('www.google.com')
// false
syncIsPrivateHost.isPrivate('tiny.pictures')
// false

syncIsPrivateHost.isPublic('localhost')
// false

Readme

Keywords

none

Package Sidebar

Install

npm i sync-is-private-host

Weekly Downloads

10

Version

1.0.0

License

ISC

Unpacked Size

3.67 kB

Total Files

7

Last publish

Collaborators

  • erkstruwe