devonport

1.0.0 • Public • Published

Dev-On-Port

Generate TCP ports from strings, for predictable local development

Purpose

Ever worked in a big dev team doing micro-services? Production deployment is managed via a proper orchestration system but local dev can be a mess when everyone's services are fighting for port 8000-8010.

You need a predictable way of binding to a probably unused port in a predictable manner, so that other services can talk back to you reliably in your local environment.

Enter Dev-On-Port! the handy-dandy device that turns your service name into a port number between 1024 and 65000.

Example:

const devonport = require('devonport');
 
let port = devonport('my-cool-service-name');  // 61410

Now use port to bind too, and port from client code to talk to your local service by it's service name and not a number, it's like DNS for your ports! (not really)

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i devonport

      Weekly Downloads

      2

      Version

      1.0.0

      License

      ISC

      Last publish

      Collaborators

      • g5095