iso3166-1

0.5.1 • Public • Published

iso3166-1 Build Status

Version License Downloads Deps DevDeps

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

Install

npm install --save iso3166-1

Usage

var iso31661 = require('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('iso3166-1')
iso31661.to2('USA') // US
iso31661.to3('US')  // USA
var iso31661 = require('iso3166-1')
var locale2 = require('locale2')
iso31661.fromLocale(locale2).to3() // USA
iso31661.fromLocale(locale2).to2() // US
import iso31661 from 'iso3166-1';
iso31661.is2('US')  // true
iso31661.is3('USA') // true
iso31661.is2('XX')  // false
iso31661.is3('XXX') // false

License

MIT

Package Sidebar

Install

npm i iso3166-1

Weekly Downloads

1,726

Version

0.5.1

License

MIT

Unpacked Size

74.8 kB

Total Files

9

Last publish

Collaborators

  • moimikey