SOS
Worldwide Emergency Services Numbers, with self-updater.
Installing
npm install sos
Usage
const sos = ; // .countryInfo('ISO_code') gives you details about the countryconsole; // .isMemberOf112('ISO_code') true if the country is part // of the 112 emergency number groupconsole; // .isLocalOnly('ISO_code') true if you can call their // emergency numbers internationallyconsole;
to get emegergency numbers of a country:
sossossossos
Each returns an array of emergency numbers, each is an object:
exp: { "type": "All", "value": "911" }
type can be:
- "All": you can call from GSM and Fixed phones.
- "GSM": you can call from GSM only.
- "Fixed": you can call from a landline only.
or to get numbers of all departements:
all'ISO_code'
// examplesconsole;console;console;console;// output/*Is Morocco a member of the 112 group falseCan you call US emergency numbers internationally falseFrench police number is 17Greece ambulance number is 166Japan fire number is 119US dispatch number is 911*/
To update the emergency numbers dataset
sos //returns a promise.
example:
const updateDataset = async { let results = await sos; console} // run the updateDataset function every daycont dayInMilliseconds = 1000 * 60 * 60 * 24;;
Contribute
Please help us keep the emergency numbers dataset up to date
You can make a pull request adding your country's emergency numbers
or if you have some time, you can update the dataset from this WikiPedia page and add what's messing.