开发者社区> 镜像站> NPM> iso3166-1
iso3166-1
Tiny, fast, modular ISO 3166-1 alpha-2/alpha-3 parser.
Last updated 10 months ago by moimikey .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install iso3166-1 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.5.1                                ...           latest (10 months ago)

18 Versions

  • 0.5.1                                ...           10 months ago
  • 0.5.0                                ...           2 years ago
  • 0.4.2                                ...           2 years ago
  • 0.4.1                                ...           2 years ago
  • 0.4.0                                ...           2 years ago
  • 0.3.0                                ...           4 years ago
  • 0.2.8                                ...           5 years ago
  • 0.2.7                                ...           5 years ago
  • 0.2.6                                ...           5 years ago
  • 0.2.5                                ...           5 years ago
  • 0.2.4                                ...           5 years ago
  • 0.2.3                                ...           5 years ago
  • 0.2.2                                ...           6 years ago
  • 0.2.1                                ...           6 years ago
  • 0.2.0                                ...           6 years ago
  • 0.1.2                                ...           6 years ago
  • 0.1.1-beta                                ...           6 years ago
  • 0.1.0-beta                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 1
Dependencies (0)
None
Dev Dependencies (20)