0.1.0 • Published 6 years ago

id2port v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

id2port

Generates a port for usage according to the given string id.

Example

const id2port = require("id2port").default;

var ports = id2port("abc");

console.log(ports.next().value); // 22156
console.log(ports.next().value); // 22157

Details

This function will travel the ports from 1 - 65535 according to the given id as long as you continue calling next() until all ports are viewed, but it will skip some well-known ports as module well-known-ports suggests.

Notes

This module doesn't detect if the returning port is being used or not, you must do detect it yourself.