Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
poeditor-utils
Advanced tools
higher-level POEditor utilities for Node.js
import * as utils from 'poeditor-utils'
import * as fs from 'fs'
const languageCodeOverrides = {
'pt-br': 'pt',
}
const translations = await utils.getTranslations('API token', [
'project A',
'project B',
])
const translationsByLanguage = utils.groupTranslations(translations, (translation) => translation.languageCode)
translationsByLanguage.forEach((translations, languageCode) => {
const language = languageCodeOverrides[languageCode] || languageCode
const data = utils.formatTranslationsAsJson(translations, {
indent: 2,
})
fs.writeFileSync(`./translations/${language}.json`, data)
})
projectName: string
languageCode: string
term: string
value: string
Translation of a single term to a single language.
apiToken: string
projectNames: string[]
Promise<Translation[]>
Gets translations for multiple projects for all the project languages.
translations: Translation[]
grouper: (translation: Translation) => string
Map<string, Translation[]>
Groups translations by keys produced by grouper
.
translations: Translation[]
options: Object
indent: number | string
string
Formats translations to string as stable sorted JSON.
apiToken: string
- POEditor API tokenExposes the poeditor-client Client
. See their docs for more.
apiToken: string
- POEditor API tokenprojectName: string
- POEditor project nameReturns a promise which resolves with a poeditor-client Project
representation of the project. See their docs for more.
apiToken: string
- POEditor API tokenprojectName: string
- POEditor project namegetPathCallback: (translation: Translation) => string
- produces destination file path for given translationGets translations for all the project languages and writes them to files by getPathCallback
as a stable sorted JSON. Returns a promise which resolves with an array of file paths written.
utils.pullTranslations('API token', 'project name', (translation) => {
return 'translations/' + translation.languageCode + '.json'
})
.then((paths) => {
console.log(paths) // ['translations/en.json', ...]
})
FAQs
higher-level POEditor utilities for Node.js
The npm package poeditor-utils receives a total of 168 weekly downloads. As such, poeditor-utils popularity was classified as not popular.
We found that poeditor-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 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
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.