@unly/iso3166-1

Tiny, fast, modular ISO 3166-1 alpha-2/alpha-3 parser.

Usage no npm install needed!

<script type="module">
  import unlyIso31661 from 'https://cdn.skypack.dev/@unly/iso3166-1';
</script>

README

Unly logo

iso3166-1 Build Status

Version License Downloads Deps DevDeps Maintainability Test Coverage Known Vulnerabilities

The smallest, fastest, node module for ISO 3166-1 alpha 2/3 helper lookup/parser. Browserify/Webpack friendly.

Install

npm install --save @unly/iso3166-1

Usage

var iso31661 = require('@unly/iso3166-1')
iso31661.from('USA').to3()         // USA
iso31661.from('USA').to2()         // US
iso31661.from('US').to3()          // USA
iso31661.from('US').to2()          // US
iso31661.fromLocale('en-US').to3() // USA
iso31661.fromLocale('en-US').to2() // US
var iso31661 = require('@unly/iso3166-1')
iso31661.to2('USA') // US
iso31661.to3('US')  // USA
var iso31661 = require('@unly/iso3166-1')
var locale2 = require('locale2')
iso31661.fromLocale(locale2).to3() // USA
iso31661.fromLocale(locale2).to2() // US
import iso31661 from '@unly/iso3166-1';
iso31661.is2('US')  // true
iso31661.is3('USA') // true
iso31661.is2('XX')  // false
iso31661.is3('XXX') // false

License

MIT

Vulnerability disclosure

See our policy.


Contributors and maintainers

This project is being maintained by:


[ABOUT UNLY] Unly logo

Unly is a socially responsible company, fighting inequality and facilitating access to higher education. Unly is committed to making education more inclusive, through responsible funding for students. We provide technological solutions to help students find the necessary funding for their studies.

We proudly participate in many TechForGood initiatives. To support and learn more about our actions to make education accessible, visit :

Tech tips and tricks from our CTO on our Medium page!

TECHFORGOOD #EDUCATIONFORALL