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

@hoppen/iso639

v1.0.3

Published

select language of ISO 639

Downloads

309

Readme

ISO 639

maintainer: Florian Oudard (FOU)

Introduction

This project aims to provide an ISO 639-2 list of most of the languages spoken. This project working on nodeJS backend or on a javascript frontend.

Properties

languages

Array of object with all commons available ISO 639 languages

  • name: english language name
  • original name: original language name
  • iso6391: iso639-1 code
  • iso6392: iso639-2 code
  • iso6393: iso639-3 code

Methods

getOriginalNamebyIso6391 getOriginalNamebyIso6392 getOriginalNamebyIso6393

Example:

iso639.getOriginalNamebyIso6391('fr');
// expected output: Français

getNamebyIso6391 getNamebyIso6392 getNamebyIso6393

Example:

iso639.getNamebyIso6391('fr');
// expected output: French

getIso6391 getIso6391 getIso6391

Example:

iso639.getIso6391('french');
// expected output: fr
iso639.getIso6392('french');
// expected output: fra/fre
iso639.getIso6392('français');
// expected output: fra/fre

Frontend side

You have acces to an iso639-2 array in the window:

<!doctype html>

<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>ISO639-2</title>
    </head>
    <body>
        <script src="dist/iso639-2.min.js"></script>
        <script>
            console.log(window.iso639.languages);
            /* expected output:
                [
                    {
                        name: 'Arabic',
                        originalName: 'العربية',
                        iso6391: 'ar',
                        iso6392: 'ara',
                        iso6392: 'ara',
                    },
                    {
                        name: 'English',
                        originalName: 'English',
                        iso6391: 'en',
                        iso6392: 'eng',
                        iso6393: 'eng',
                    },
                    {
                        name: 'French',
                        originalName: 'Français',
                        iso6391: 'fr',
                        iso6392: 'fre/fra',
                        iso6393: 'fra',
                    },
                    {
                        name: 'German',
                        originalName: 'Deutsch',
                        iso6391: 'de',
                        iso6392: 'ger/deu',
                        iso6393: 'deu',
                    },
                    ...
                ]
            */
        </script>
    </body>
</html>

or ES6 import:

import iso639 from 'dist/iso639.min.js';

iso639.iso6391ToIso6393('fr');
// expected output: fra

Backend side

const iso639 = require('dist/iso639-2.min.js');

iso639.getLanguageName('fra');
// expected output: French

Contributing

Development

To install dev dependencies:

npm ci

To generate new production code into dist:

npm run make

Versionning

new_version="x.y.z"
git flow release start $new_version
npm version $new_version
# edit any other file / last minute fix
git add .
git commit -m "bump version $new_version"
git fetch origin master:master
export GIT_MERGE_AUTOEDIT=no
git flow release finish \
  --fetch \
  --push \
  --message "$new_version" \
  --showcommands \
  --tagname "$new_version" \
  "$new_version"
unset GIT_MERGE_AUTOEDIT