1.0.0 • Published 1 year ago

is-lo v1.0.0

Weekly downloads
147
License
MIT
Repository
github
Last release
1 year ago

is-lo  npm build License

:repeat: Check if it is a loopback network interface or not

Getting Started

$ npm install --save is-lo # for npm users
$ yarn add is-lo           # for yarn users

Features

  • Supports TypeScript
  • Supports both CommonJS and ESModules

Usage

import os from 'node:os'
import { isLo } from 'is-lo'

const interfaces = os.networkInterfaces()
const names = Object.keys(interfaces)

console.log(isLo(interfaces[names[0]])) // true or false

Reference

isLo({ family: 'IPv4', address: '127.0.0.1' })

isLo([ { family: 'IPv4', address: '127.0.0.1' }, ... ])

  • family (string): 'IPv4' or 'IPv6'
  • address (string): IP address
  • Result (bool): true if it is loopback network interface

Development

Test

$ yarn test

Publish

$ yarn publish

License

MIT © Pine Mizune

1.0.0

1 year ago

0.2.6

6 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago