country-data
Advanced tools
Comparing version 0.0.11 to 0.0.12
# Changes | ||
## v0.0.12 | ||
* @bebrow contributed `lookup()` | ||
## v0.0.11 | ||
@@ -4,0 +8,0 @@ |
var countriesAll = require('./data/countries.json'), | ||
currenciesAll = require('./data/currencies.json'), | ||
regions = require('./data/regions'), | ||
lookup = require('./lookup'), | ||
_ = require('underscore'); | ||
@@ -25,1 +26,5 @@ | ||
exports.regions = regions; | ||
exports.lookup = lookup({ | ||
countries: countriesAll, | ||
currencies: currenciesAll | ||
}); |
{ | ||
"name": "country-data", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "Data about countries - like their ISO codes and currencies", | ||
@@ -26,3 +26,4 @@ "homepage": "https://github.com/OpenBookPrices/country-data", | ||
"csv": "~0.2.9", | ||
"mocha": "~1.9.0" | ||
"mocha": "~1.9.0", | ||
"chai": "~1.8.1" | ||
}, | ||
@@ -29,0 +30,0 @@ "dependencies": { |
@@ -42,3 +42,7 @@ # Country Data | ||
## Lookup | ||
To make finding easier there are utility methods that can search the countries and currencies. See examples below. | ||
## Installing | ||
@@ -73,2 +77,12 @@ | ||
``` javascript | ||
var lookup = require('country-data').lookup; | ||
// Match a value (grab first from array) | ||
var france = lookup.countries({name: 'France'})[0]; | ||
// Or match one of several possible values. | ||
var eurozone_countries = lookup.countries({currencies: 'EUR'}); | ||
``` | ||
It is very simple for now - feel free to contribute more helpful accessors. | ||
@@ -75,0 +89,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
143502
22
4951
153
4