Socket
Socket
Sign inDemoInstall

language-tags

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

language-tags

Work with IANA language tags.


Version published
Maintainers
1
Created

What is language-tags?

The language-tags npm package is a utility for working with IETF language tags (BCP 47). It provides functionality to parse, validate, and manipulate language tags, making it useful for handling language data in applications that need to support internationalization.

What are language-tags's main functionalities?

Parsing and Validating Language Tags

This feature allows you to parse a language tag string and check if it is valid according to BCP 47 standards. The example demonstrates how to parse the tag 'en-GB' and check its validity.

const tags = require('language-tags');
const tag = tags('en-GB');
console.log(tag.valid()); // true

Subtag Lookup

This feature enables looking up details of specific subtags within a language tag. In the example, it retrieves descriptions for the language subtag of 'en-GB'.

const tags = require('language-tags');
const tag = tags('en-GB');
console.log(tag.language().descriptions()); // ['English']

Data Access

This feature provides access to additional data related to a language tag, such as its scope, type, and more. The example shows how to access the scope of the 'en' language tag.

const tags = require('language-tags');
const data = tags('en').data();
console.log(data.scope); // 'macrolanguage'

Other packages similar to language-tags

Keywords

FAQs

Package last updated on 15 Dec 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