Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

iso-639-1

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iso-639-1

ISO-639-1 codes

  • 2.1.13
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
254K
increased by8.23%
Maintainers
1
Weekly downloads
 
Created

What is iso-639-1?

The iso-639-1 npm package provides utilities for working with ISO 639-1 language codes. It allows you to get language names from codes, get codes from language names, and check if a language code is valid.

What are iso-639-1's main functionalities?

Get Language Name from Code

This feature allows you to get the name of a language given its ISO 639-1 code. In the example, the code 'en' returns 'English'.

const ISO6391 = require('iso-639-1');
const languageName = ISO6391.getName('en');
console.log(languageName); // Output: English

Get Language Code from Name

This feature allows you to get the ISO 639-1 code of a language given its name. In the example, the name 'English' returns the code 'en'.

const ISO6391 = require('iso-639-1');
const languageCode = ISO6391.getCode('English');
console.log(languageCode); // Output: en

Check if a Language Code is Valid

This feature allows you to check if a given ISO 639-1 code is valid. In the example, the code 'en' is validated and returns true.

const ISO6391 = require('iso-639-1');
const isValid = ISO6391.validate('en');
console.log(isValid); // Output: true

Get All Language Codes

This feature allows you to get an array of all ISO 639-1 language codes. The example returns an array containing all the codes.

const ISO6391 = require('iso-639-1');
const allCodes = ISO6391.getAllCodes();
console.log(allCodes); // Output: Array of all ISO 639-1 language codes

Get All Language Names

This feature allows you to get an array of all ISO 639-1 language names. The example returns an array containing all the names.

const ISO6391 = require('iso-639-1');
const allNames = ISO6391.getAllNames();
console.log(allNames); // Output: Array of all ISO 639-1 language names

Other packages similar to iso-639-1

Keywords

FAQs

Package last updated on 08 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc