Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
The bcp47 npm package is a utility for parsing, validating, and manipulating BCP 47 language tags. BCP 47 is a standard for language tags that are used to identify human languages in a standardized way.
Parsing BCP 47 Language Tags
This feature allows you to parse a BCP 47 language tag into its components. For example, 'en-US' would be parsed into an object representing the language 'English' and the region 'United States'.
const bcp47 = require('bcp47');
const parsedTag = bcp47.parse('en-US');
console.log(parsedTag);
Validating BCP 47 Language Tags
This feature allows you to validate whether a given string is a valid BCP 47 language tag. For example, 'en-US' would return true, indicating it is a valid tag.
const bcp47 = require('bcp47');
const isValid = bcp47.validate('en-US');
console.log(isValid);
Stringifying BCP 47 Language Tags
This feature allows you to convert an object representing a BCP 47 language tag back into its string form. For example, an object with language 'en' and region 'US' would be converted back to 'en-US'.
const bcp47 = require('bcp47');
const tagObject = { language: 'en', region: 'US' };
const tagString = bcp47.stringify(tagObject);
console.log(tagString);
The language-tags package provides similar functionality for parsing, validating, and manipulating BCP 47 language tags. It offers a more extensive API for working with language tags, including support for subtags and extensions.
The locale package focuses on parsing and manipulating locale strings, which often include BCP 47 language tags. It provides additional functionality for handling locale-specific data such as date and number formatting.
FAQs
Parser for the BCP 47 language tag specification
The npm package bcp47 receives a total of 188,146 weekly downloads. As such, bcp47 popularity was classified as popular.
We found that bcp47 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.