JSPM

lang-codes

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 151
  • Score
    100M100P100Q75218F
  • License MIT

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

Package Exports

  • lang-codes

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (lang-codes) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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