Useful tools to translate telephone numbers to and from E164
npm install number_info






``json`
"dependencies": {
"number_info": "latest"
}
js
var number_info = require('number_info');
var result = number_info.resolve(dialedString, numberingPlan);
`numberingPlan is optional. When not supplied, it will be assumed that
dialedString is an E164 number without the leading +.If supplied, it must be a 2-letter ISO country code
that will be used to translate this number from a local dialed number into an E164 number.
In essence, the country specifices the numbering plan used
to interpret the dialed number.
For example, from the US you will dial 011+number to reach an international destination, while other
countries will have different ways for dialing local, long distance, and international
destinations (e.g: 00+number).
Examples
Below you will find a few examples for the most common usage. More examples can
be found in the tests.$3
`js
var result = number_info.resolve('18009997777');
`$3
`js
var result = number_info.resolve('005491145556666');
`Developers
This project uses standard npm scripts. Current tasks include:
* test: Runs Mocha tests.
* jsdoc: Runs JSDoc3.
* eslint: Runs ESLint.
* coverage: Runs the tests and then Instanbul to get a coverage report.
* build: This is the default task, and will run all the other tasks.Running an npm task
To run a task, just do:`sh
npm run build
`Contributing
To contribute:
* Make sure you open a concise and short pull request.
* Throw in any needed unit tests to accomodate the new code or the
changes involved.
* Run npm run build` and make sure everything is ok before submitting the pullCheck LICENSE file for more information.