1.0.1 • Published 6 years ago

sockaddr v1.0.1

Weekly downloads
383
License
BSD-3-Clause
Repository
github
Last release
6 years ago

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.