reserved-number-cli
v1.0.4
Published
Allocate and deallocate numbers (one per name) on the command line.
Maintainers
Readme
reserved-number-cli
Allocate and deallocate numbers.
install
npm install -g reserved-number-cliset up
You have to pass in three properties each time you run this:
--minimumThe smallest number allowed (inclusive).--maximumThe biggest number allowed (inclusive).--settingsThe filesystem path to the JSON file storing the numbers.
The easiest way to do this is to create an alias:
alias resnum="reserved-number --minimum=4000 --maximum=6000 --settings=/path/to/settings.json"use it
If you've set it up with the alias above, you'd use it like this:
resnum [allocate|a|get|g|deallocate|d] [name]allocate number
Allocate an unused number out of the min/max range with the name myapp
resnum allocate myapp
resnum a myappThe output will be the allocated number, if enough free numbers are available, or an error if not enough numbers are available.
get an allocated number
Get a previously allocated number:
resnum get myapp
resnum g myappThe output will be the number, if one has been allocated for that name, or an error if a number has not been allocated for that name.
deallocate number
Deallocate a previously allocated number:
resnum deallocate myapp
resnum d myappThe output is always blank.
