New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@phensley/language-tag

Package Overview
Dependencies
Maintainers
0
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@phensley/language-tag

Parsing and construction of BCP 47 language tags

  • 1.10.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.6K
increased by5.6%
Maintainers
0
Weekly downloads
 
Created
Source

@phensley/language-tag

@phensley/language-tag min+gzip

Implements BCP 47 language tag parsing and construction.

Installation

NPM:

npm install --save @phensley/language-tag

Yarn:

yarn add @phensley/language-tag

Examples

const IDS = ['en', 'es', 'es-419', 'und-AR', 'und-Hant', 'iw', 'i-klingon'];
for (const id of IDS) {
  const tag = parseLanguageTag(id);
  console.log(`${tag.compact().padStart(10)}  ${tag.expanded()}`);
}
        en  en-Zzzz-ZZ
        es  es-Zzzz-ZZ
    es-419  es-Zzzz-419
    und-AR  und-Zzzz-AR
  und-Hant  und-Hant-ZZ
        iw  iw-Zzzz-ZZ
       tlh  tlh-Zzzz-ZZ
const t = new LanguageTag(undefined, 'latn', 'us', 'PoSiX', {
  u: ['ca-gregory']
});
console.log(t.expanded());
und-Latn-US-posix-u-ca-gregory

FAQs

Package last updated on 10 Feb 2025

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