@iso-639/data
v0.2.0
Published
Contains code lists for ISO 639-1 and ISO 639-2 as well as multi-language support.
Downloads
14
Maintainers
Readme
@iso-639/data
Contains code lists for ISO 639-1 and ISO 639-2 as well as multi-language support.
Friendly Reminder
We provided @iso-639/mapping mapping toolkit, which can easily help you manage language data.
Usage
With npm(or yarn, or pnpm):
npm install @iso-639/data
In .js
/ .ts
or other files:
// ISO 639-1 is stored in the `1` directory
import ISO_639_1_EN from '@iso-639/data/1/en.json'
import ISO_639_1_ZH_CN from '@iso-639/data/1/zh-CN.json'
// ISO 639-2 is stored in the `2` directory
import ISO_639_2_EN from '@iso-639/data/2/en.json'
import ISO_639_2_ZH_CN from '@iso-639/data/2/zh-CN.json'
With CDN:
<script>
const res = await fetch('https://cdn.jsdelivr.net/npm/@iso-639/data/1/en.json')
const json = await res.json()
</script>
Multi-language Support
JSON files named with language codes in the source code directory are supported languages.
See: Source Code
Release Notes
Please refer to CHANGELOG for details.
License
MIT License © 2023-PRESENT chengpeiquan