npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

iso-countries

v0.0.5

Published

ISO Country and Currency Codes

Downloads

784

Readme

ISO Country Codes - a little javascript helper

This library is a javascript version of the dataset originally published by Andrew Patton. This dataset merges information from ISO, United Nations and the CIA World Factbook.

By converting the dataset to javascript objects you can access commonly required information (name, currency etc) just using the two letter ISO 3166-1 alpha-2 code. Additional methods are available to search for countries by current, name, international telephone dialling prefix, top-level internet domain etc.

It works in both Node.js and the web browser.

Important - needs to be updated with ISO changes from the last few years.

Installation

TODO: add package to npm

For use in Node.js:

npm install isocountries

or

npm install git://github.com/psmithuk/iso-countries

In the browser just copy the file from dist\countries.min.js (skinny) or dist\countries.js (full-fat).

Building

To create distributable files:

npm install
make dist

To run the tests (requires mocha and should):

make test

To run everything

make all

Usage

TODO - add once finder methods are complete

See tests for now. Sorry.

License

TODO

Changes to the data

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).

Notes

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.

Future

  • 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