ISO 639-1/2/3 Language codes with English and local names
Installations
npm install langs
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
7.7.3
NPM Version
4.1.2
Score
99.3
Supply Chain
99.5
Quality
75
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
Download Statistics
Total Downloads
10,289,573
Last Day
7,417
Last Week
33,521
Last Month
138,033
Last Year
2,233,728
GitHub Statistics
116 Stars
23 Commits
21 Forks
3 Watching
2 Branches
5 Contributors
Bundle Size
15.38 kB
Minified
5.60 kB
Minified + Gzipped
Package Meta Information
Latest Version
2.0.0
Package Id
langs@2.0.0
Size
9.91 kB
NPM Version
4.1.2
Node Version
7.7.3
Publised On
19 Mar 2017
Total Downloads
Cumulative downloads
Total Downloads
10,289,573
Last day
3%
7,417
Compared to previous day
Last week
-10.2%
33,521
Compared to previous week
Last month
3.5%
138,033
Compared to previous month
Last year
49.2%
2,233,728
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Langs
![Langs](http://media.giphy.com/media/ZJqPtMjmHbNN6/giphy.gif)
$ npm install langs
This library provides ISO 639-1/2/3 language codes with English and local names. It can be installed in whichever way you prefer, but I recommend NPM.
What's with all the ISO version numbers?
ISO 639 is broken up into many different parts, each either defining language codes or defining standards for codes in later versions. The ones included in this library are:
ISO 639-1
2 characters, one per language or ISO 639 macrolanguageISO 639-2/2T
3 characters, one per languageISO 639-2B
3 characters, mostly the same as639-2T
but with some derived from their English name rather than local nameISO 639-3
3 characters, mostly the same as639-2T
but using the canonical ISO 639 macrolanguage code
The macrolanguages described above cover cases where a language is considered
to be a dialect of another in some standards but not in others, e.g Standard
Arabic arb
and Arabic ara
. There's more information on the
Wikipedia page.
Documentation
1var langs = require('langs'); 2 3langs.all(); 4// [ 5// {"name":"English", "local":"English", "1":"en", "2":"eng", "2T":"eng", "2B":"eng", "3":"eng"}, 6// {"name":"Korean", "local":"í•œêµì–´", "1":"ko", "2":"kor", "2T":"kor", "2B":"kor", "3":"kor"}, 7// ... 8// ] 9 10langs.names(); 11// [ 12// "English", 13// "Korean", 14// ... 15// ] 16 17langs.names(true); 18// [ 19// "English", 20// "í•œêµì–´", 21// ... 22// ] 23 24langs.codes("1"); 25// [ 26// "en", 27// "ko", 28// ... 29// ] 30 31langs.codes("2T" /*same as "2"*/); 32// [ 33// "eng", 34// "kor", 35// ... 36// ] 37 38langs.codes("2B"); 39// [ 40// "eng", 41// "kor", 42// ... 43// ] 44 45langs.codes("3"); 46// [ 47// "eng", 48// "kor", 49// ... 50// ] 51 52langs.where("name", "Korean"); 53// {"name":"Korean", "local":"í•œêµì–´", "1":"ko", "2":"kor", "2T":"kor", "2B":"kor", "3":"kor"} 54 55langs.where("local", "í•œêµì–´, ì¡°ì„ ì–´"); 56// {"name":"Korean", "local":"í•œêµì–´", "1":"ko", "2":"kor", "2T":"kor", "2B":"kor", "3":"kor"} 57 58langs.where("1", "ko"); 59// {"name":"Korean", "local":"í•œêµì–´", "1":"ko", "2":"kor", "2T":"kor", "2B":"kor", "3":"kor"} 60 61langs.where("2", "kor"); 62// {"name":"Korean", "local":"í•œêµì–´", "1":"ko", "2":"kor", "2T":"kor", "2B":"kor", "3":"kor"} 63 64langs.where("2T", "kor"); 65// {"name":"Korean", "local":"í•œêµì–´", "1":"ko", "2":"kor", "2T":"kor", "2B":"kor", "3":"kor"} 66 67langs.where("2B", "kor"); 68// {"name":"Korean", "local":"í•œêµì–´", "1":"ko", "2":"kor", "2T":"kor", "2B":"kor", "3":"kor"} 69 70langs.where("3", "kor"); 71// {"name":"Korean", "local":"í•œêµì–´", "1":"ko", "2":"kor", "2T":"kor", "2B":"kor", "3":"kor"} 72 73langs.has("name", "Korean"); 74// true 75 76langs.has("local", "í•œêµì–´, ì¡°ì„ ì–´"); 77// true 78 79langs.has("1", "ko"); 80// true 81 82langs.has("2", "kor"); 83// true 84 85langs.has("2T", "kor"); 86// true 87 88langs.has("2B", "kor"); 89// true 90 91langs.has("3", "kor"); 92// true 93 94langs.has("name", "Geordie"); 95// false 96 97langs.has("high", "fives"); 98// false
Contributing
I accept contributions to the source via Pull Request, but passing unit tests must be included before it will be considered for merge.
1$ curl -O https://raw.githubusercontent.com/adlawson/vagrantfiles/master/nodejs/Vagrantfile 2$ vagrant up 3$ vagrant ssh 4$ cd /srv 5 6$ npm test
License
The content of this library is released under the MIT License by
Andrew Lawson.
You can find a copy of this license in
LICENSE
or at http://www.opensource.org/licenses/mit.
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
0 existing vulnerabilities detected
Reason
Found 4/20 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 7 are checked with a SAST tool
Score
3.3
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More