sockaddr

1.0.1 • Public • Published

node-sockaddr

Build Status Coverage Status Greenkeeper badge

A simple library to convert a string into an object suitable to pass to net.Socket.connect and net.Server.listen. Useful for configuration files and setting hosts and ports in environment variables. Supports both Unix domain sockets and TCP sockets.

Usage

const sockaddr = require('sockaddr');

let socket = ...;
socket.connect(sockaddr('hostname:1234'));

See [./test.js] for the full set of options supported.

Readme

Keywords

none

Package Sidebar

Install

npm i sockaddr

Weekly Downloads

1,668

Version

1.0.1

License

BSD-3-Clause

Unpacked Size

94.4 kB

Total Files

9

Last publish

Collaborators

  • gcampax
  • sileixu