Security News
Internet Archive Hacked, 31 Million Record Compromised
The Internet Archive's "Wayback Machine" has been hacked and defaced, with 31 millions records compromised.
country-data
Advanced tools
There are lots of little bits of data that you often need relating to countries, and I couldn't find any easy to use source of it. So I compiled it all here.
The data currently provided for each country is:
name
The english name for the countryalpha2
The ISO 3166-1 alpha 2 codealpha3
The ISO 3166-1 alpha 3 codecurrencies
An array of ISO 4217 currency codes with the primary one firstIt is not that useful to just have the currency code(s) for a country, so included is currency data too:
* `name` The english name for the currency
* `code` The [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) code
* `number` The [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) number
* `decimals` The number of decimal digits conventionally shown
npm install country-data
var countries = require('country-data').countries,
currencies = require('country-data').currencies;
// countries are found using alpha2 or alpha3
console.log( countries.alpha2.BE.name ); // 'Belgium'
console.log( countries.alpha3.FRA.currencies ); // ['EUR']
// currencies are accessed by their code
console.log( currencies.code.USD.name ); // 'United States dollar'
It is very simple for now - feel free to contribute more helpful accessors.
More data for each country is most welcome. Obvious things that it might be nice to add are:
The data is finally stored as JSON, but this is not always easy to manipulate. For this it is easier to edit the CSV files (using spreadsheet software) and then use the scripts in the data directory to convert the CSV to JSON. Please don't edit the JSON directly, but do it via the CSV.
These are the steps required
# Clone the repo (or better your fork of it)
git clone https://github.com/LinkToBooks/country-data.git
cd country-data
# install the dependencies
npm install .
# Edit the countries.csv
open countries.csv
# Convert the CSV to JSON
node data/country_csv_to_json.js > data/countries.json
# Run the tests
mocha
# If all is ok commit and push
git add .
git commit
git push
# Then send a pull request with your changes
The currency data was copied from the Wikipedia ISO 4217 page.
v0.0.2
FAQs
Data about countries - like their ISO codes and currencies
The npm package country-data receives a total of 53,861 weekly downloads. As such, country-data popularity was classified as popular.
We found that country-data demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Internet Archive's "Wayback Machine" has been hacked and defaced, with 31 millions records compromised.
Security News
TC39 is meeting in Tokyo this week and they have approved nearly a dozen proposals to advance to the next stages.
Security News
Our threat research team breaks down two malicious npm packages designed to exploit developer trust, steal your data, and destroy data on your machine.