Skip to content

Small JS library to parse a string into a nodejs socket address

License

Notifications You must be signed in to change notification settings

stanford-oval/node-sockaddr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-sockaddr

Build Status Coverage Status Dependency Status Greenkeeper badge Language grade: JavaScript

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.

About

Small JS library to parse a string into a nodejs socket address

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •