npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

all-iso-language-codes

v1.0.14

Published

List of all iso 639-1, 639-2T, 639-2B, 639-3 codes with their translations in any language

Downloads

3,023

Readme

List of ISO 639-1, 639-2T, 639-2B and 639-3 codes with translations in all available languages

Sometimes you need to get a fresh list of 639-1, 639-2T, 639-2B or 639-3 language codes and their translations. Until now there was not an easy way to get them.

All data are available in json format in data/[language]/639-1.json. More formats might be available in the future.

Usage

  1. JS functions (with TS type definitions included)
  2. Directly, using files located in data folder

JS functions

| Function | Arguments | Return value | Example usage | |---|---|---|---| | getEnglishName(code: string) | language code | string | null | getEnglishName('cs') => Czech | | getNativeName(code: string) | language code | string | null | getNativeName('cs') => čeština | | getName(code: string, language = 'en') | from language, to language? | string | null | getName('cs', 'en') => Czech | | isValid(code: string, availableIsoTypes?: IsoType[], moreInfo = false) | language code, IsoType (below table), moreInfo | boolean | { iso: IsoType | null; found: boolean; } | isValid('cs') => true, isValid('cs', ['639-1'], true) => { iso: '639-1'; found: true; }, | | getIsoCodesFromNativeName(nativeName: string, normalizeString = false) | language name, should normalize string (lowercase and remove diacritics) | IsoType[] | null | getIsoCodesFromNativeName('ČeŠtInA', true) => ['639-3', '639-2B', '639-2T', '639-1'] | | getAll639_1() | - | string[] (639-1 array) | getAll639_1() => ['aa', 'ab', 'af'...] | | getAll639_2B() | - | string[] (639-2B array) | getAll639_2B() => ['aar', 'abk', 'ace'...] | | getAll639_2T() | - | string[] (639-2T array) | getAll639_2T() => ['aar', 'abk', 'ace'...] | | getAll639_3() | - | string[] (639-3 array) | getAll639_3() => ['aaa', 'aab', 'aac'...] |

type IsoType = '639-1' | '639-2B' | '639-2T' | '639-3'

File format

If you have some ideas (csv, another JSON format...) let me know or create PR.

Adding more languages

Language matrix is generated by Node.js Intl API (version 21.3.0). If you would like to edit something, Create PR in Node.js Intl API. Wait until release and run yarn generate.

Tests

There are jest tests which tests basic functionality. Feel free to extend them or convert to vitest.

More info

Getting the list of all available languages is from official list

More packages from me

  • all-iso-language-codes - List of ISO 639-1, 639-2T, 639-2B and 639-3 codes with translations in all available languages
  • expo-video-player - Customizable Video Player controls for Expo
  • free-email-domains-list - Fresh list of all free email domain providers. Can be used to check if an email address belongs to a company. Updated weekly