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.
@cloudflare/intl-core
Advanced tools
@cloudflare/intl-core
This package provides core utilities for i18n.
$ npm install @cloudflare/intl-core
This is a wrapper around the functions of Polyglot.
The main benefit it provides is that it stores various instances of Polyglot for each locale in order to be able to locate translations which are not found in target locale but are found in English locale.
import Translator from '@cloudfalre/intl-core';
const phrases = {
phrase_key: 'phrase_value',
second_phrase: 'second_value'
};
const germanPhrases = {
phrase_key: 'german_value'
};
const translator = new Translator({
phrases
});
translator.locale(ESupportedLocales.de_DE);
translator.extend(germanPhrases);
translator.t('phrase_key'); //returns german_value since it's found for the german locale
translator.t('second_phrase'); //returns second_value since it was not found in german locale but was found in English locale
This is a function which takes an object mapping each locale
to a function
returning a Promise which resolves to the catalog of phrases for that locale
.
The main usecase for this is to provide a way to asynchronously load phrases
based on locale
. You can include an index.ts
file inside your locale
directory with the following content:
import { makeLoadPhrases, ESupportedLocales } from '@cloudflare/intl-core';
const loadPhrases = makeLoadPhrases({
[ESupportedLocales.en_US]: () => import('./en-US/phrases.json')
//...other locales
});
export default loadPhrases;
FAQs
Unknown package
The npm package @cloudflare/intl-core receives a total of 4,943 weekly downloads. As such, @cloudflare/intl-core popularity was classified as popular.
We found that @cloudflare/intl-core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.