lang-codes

1.0.0 • Public • Published

lang-codes

package version package downloads standard-readme compliant package license make a pull request

Easily searchable ISO 639-1/2/3 Language codes

Table of Contents

About

Easily searchable ISO 639-1/2/3 language codes with English and local names (under 6kB gzipped). Data extracted from nodejs-langs.

Install

This project uses node and npm.

$ npm install lang-codes
# OR 
$ yarn add lang-codes

Usage

import find from 'lang-codes'
 
find('afr') // { 'name': 'Afrikaans', 'local': 'Afrikaans', '1': 'af', '2': 'afr', '2T': 'afr', '2B': 'afr', '3': 'afr' }
find(/af/) // [ { '1': 'aa', '2': 'aar', '3': 'aar', name: 'Afar', local: 'Afaraf', '2T': 'aar', '2B': 'aar' }, { '1': 'af', '2': 'afr', '3': 'afr', name: 'Afrikaans', local: 'Afrikaans', '2T': 'afr', '2B': 'afr' } ]
find('zul', { props: 'name' }) // Zulu
 

Contribute

  1. Fork it and create your feature branch: git checkout -b my-new-feature
  2. Commit your changes: git commit -am 'Add some feature'
  3. Push to the branch: git push origin my-new-feature
  4. Submit a pull request

License

MIT

Package Sidebar

Install

npm i lang-codes

Weekly Downloads

190

Version

1.0.0

License

MIT

Unpacked Size

188 kB

Total Files

18

Last publish

Collaborators

  • tiaanduplessis