It works in both Node.js and the web browser.
For use in Node.js:
npm install iso-countries
In the browser just copy the file from
dist\countries.min.js (skinny) or
To create distributable files:
npm install make dist
To run the tests (requires
To run everything
TODO - add once finder methods are complete
See tests for now. Sorry.
I've included a copy of the source data file
isocountry_detailed.txt. If you believe updates are required pleases let me know. If you disagree with the United Nations or ISO on the status or name of a country then you should probably fork your own version (or this repo, not the country).
This library uses the reserved ISO 3166-1 alpha-2 code 'XX' to represent Worldwide. This might not be for everyone but it was consistent with my personal use cases. I'll probably add a build option to exclude this.
Likely to split the browser version into two (regular and light) so that more fields such as population and local names can be included.
Provide CSS files for flags