
Company News
/Security News
Socket Selected for OpenAI's Cybersecurity Grant Program
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.
html-lang-primary-subtags
Advanced tools
Typed primary language subtags plus BCP-47 and Open Graph locale string unions.
TypeScript union type for primary language subtags (ISO-639 / IANA) compatible with the HTML lang="" attribute.
This package provides a strictly typed union of all registered primary language subtags, without regions, scripts, variants, or extensions.
Useful for:
lang attribute safelynpm install html-lang-primary-subtags
import type { PrimaryLanguageSubtag } from "html-lang-primary-subtags";
const lang: PrimaryLanguageSubtag = "en"; // ok
// const invalid: PrimaryLanguageSubtag = "en-US"; // compile-time error
PrimaryLanguageSubtag is a union of all registered primary language subtags (ISO-639) suitable for the HTML lang attribute without region/script/variant extensions.
PrimaryLanguageSubtag – primary language subtags (ISO-639-1)RegionSubtag – uppercase region codes (ISO-3166-1 alpha-2)Bcp47Locale – ${PrimaryLanguageSubtag}-${RegionSubtag} for HTML lang (BCP-47)OgLocale – ${PrimaryLanguageSubtag}_${RegionSubtag} for Open Graph tagsimport type {
PrimaryLanguageSubtag,
RegionSubtag,
Bcp47Locale,
OgLocale,
} from "html-lang-primary-subtags";
const lang: PrimaryLanguageSubtag = "en";
const region: RegionSubtag = "US";
const bcp47: Bcp47Locale = "en-US";
const ogLocale: OgLocale = "en_US";
See CHANGELOG.md for release notes.
FAQs
Did you know?

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.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.