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

language-subtag-registry

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

language-subtag-registry

Full BCP 47 language subtag data from the official IANA repository, in JSON format with multiple indices.

  • 0.3.15
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6M
decreased by-53.31%
Maintainers
1
Weekly downloads
 
Created

What is language-subtag-registry?

The language-subtag-registry npm package provides an interface to access and manipulate data from the IANA Language Subtag Registry. This registry contains codes that are used to identify human languages, scripts, countries, and variants. The package allows for searching, validating, and parsing these codes, making it useful for applications that need to handle language tags according to the IETF BCP 47 standard.

What are language-subtag-registry's main functionalities?

Searching for language subtags

This feature allows users to search the registry for specific subtags. In the code sample, the search function is used to find entries related to the 'en' subtag, which typically corresponds to English.

const { search } = require('language-subtag-registry');
const results = search('en');
console.log(results);

Validating language subtags

This feature enables the validation of language subtags to ensure they conform to the IETF BCP 47 standard. The code sample demonstrates validating the 'en-US' language tag, which represents English as used in the United States.

const { validate } = require('language-subtag-registry');
const isValid = validate('en-US');
console.log(isValid);

Parsing language subtags

This feature provides the ability to parse complex language tags into their constituent parts, such as language, script, and region. The code sample parses 'zh-Hant-HK', which represents Chinese written in the Traditional script as used in Hong Kong.

const { parse } = require('language-subtag-registry');
const parsed = parse('zh-Hant-HK');
console.log(parsed);

Other packages similar to language-subtag-registry

Keywords

FAQs

Package last updated on 18 Jul 2016

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