Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
babel-plugin-transform-format-message
Advanced tools
Pre-generate ids from default messages or inline a single language translation
Pre-generate ids from default messages or inline a single language translation
$ npm install babel-plugin-transform-format-message
.babelrc
(Recommended).babelrc
{
"plugins": [ "transform-format-message", {
"generateId": "underscored_crc32",
"inline": false
} ]
}
$ babel --plugins transform-format-message script.js
require("babel-core").transform("code", {
plugins: [
[ "transform-format-message", {
"generateId": "underscored_crc32",
"translations": "./locales",
"locale": "pt-BR"
} ]
]
})
generateId
is either a function string -> string
, or one of "literal"
, "normalized"
, "underscored"
, "underscored_crc32"
. Default is "underscored_crc32"
.inline
is a boolean. If true, the full translated message will be inlined and optimized, otherwise only generated ids will be added. Default is false
.locale
is the BCP 47 Language Tag string specifying the target language to inline. This is only used with inline: true
. Default is "en"
.translations
is an object of the form: { [locale]: { [id]: { message: '...' }, ... } }
. This is an object with keys for each locale, with values matching the extract-format-message
json output. This can also be a string path to require a module that exports a matching object.missingTranslation
is one of "ignore"
, "warning"
, "error"
. Default is "warning"
.missingReplacement
is an optional string to use in place of missing translations. By default the default message will be used.This software is free to use under the MIT license. See the LICENSE-MIT file for license text and copyright information.
FAQs
Pre-generate ids from default messages or inline a single language translation
The npm package babel-plugin-transform-format-message receives a total of 1,803 weekly downloads. As such, babel-plugin-transform-format-message popularity was classified as popular.
We found that babel-plugin-transform-format-message demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.