🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

@maboiteaspam/get-bind

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@maboiteaspam/get-bind

get bind address, not only port number

latest
npmnpm
Version
1.0.1
Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

get-bind

get bind address. The friend of get-port to get a bind address, not only a port number.

Install

npm i @maboiteaspam/get-bind --save-dev

Usage

require('./index')(8888, 'localhost')
  .then(console.log)
  .catch(console.error) // print localhost:8888

require('./index')(false, 'localhost')
  .then(console.log)
  .catch(console.error) // print localhost:[random]

require('./index')(false)
  .then(console.log)
  .catch(console.error) // print 0.0.0.0:[random]

require('./index')()
  .then(console.log)
  .catch(console.error) // print 0.0.0.0:[random]

require('./index')('some.other:6666', 'localhost')
  .then(console.log)
  .catch(console.error) // print some.other:6666

require('./index')('some.other', 'localhost')
  .then(console.log)
  .catch(console.error) // print localhost:some.other // this is buggy, to be improved later

require('./index')(':80', 'localhost')
  .then(console.log)
  .catch(console.error) // print localhost::80 // this is buggy too, to be improved later

Read More

Keywords

address

FAQs

Package last updated on 23 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts