@nuskin/mexico-state-lookup

This module provides you with search capabilities for finding Mexico state information.

The state information provided by this module is taken from the wikipedia page found here.

State object information

{ 
    name: 'Michoacán',
    abbreviation: ['Mich.'],
    internal: 'MIC',
    iso2: 'MI',
    iso3: 'MIC'
}

Installing

Usng npm:

npm add @nuskin/mexico-state-lookup

Usng yarn:

yarn add @nuskin/mexico-state-lookup

Example usage

const msc = require('@nuskin/mexico-state-lookup')

console.log(msc.byAll('Nuevo León'))
// prints - { name: 'Nuevo León', abbreviation: ['N.L.'], iso2: 'NL', iso3: 'NLE', internal: 'NL' }

console.log(msc.byName('Nuevo León'))
// prints - { name: 'Nuevo León', abbreviation: ['N.L.'], iso2: 'NL', iso3: 'NLE', internal: 'NL' }

console.log(msc.byIso('NLE').iso2)
// prints - NL

console.log(msc.byAbbr('NL').name)
// prints - Nuevo León

Resources

License

MIT