Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@doc-tools/yfm2xliff
Advanced tools
helps you translate your yfm files.
npm install @doc-tools/yfm2xliff --save
const {compose, extract} = require('@doc-tools/yfm2xliff');
git clone git@github.com:yandex-cloud/yfm2xliff.git yfm2xliff
cd yfm2xliff
npm install
npm link
library has peer dependency @doc-tools/transform
npm install @doc-tools/transform
note: types are provided for educational purposes, there is no typings available for the library for now.
type ExtractParameters = {
// source string in the format language-LOCALE, example: ru-RU, en-US
source: string;
// target string in the format language-LOCALE, example ru-RU, en-US
target: string;
// input yfm/markdown string to extract text segments from
md: string;
// path to the markdown markdown string comes from, note: crucial for valid xliff file generation
mdPath: string;
// path to where generated skeleton file will be stored(by you), note: crucial for valid xliff file generation
sklPath: string
// options to pass to yfm-transform
options: {
// array of yfm-transform plugins
plugings: [];
...
}
}
type ExtractOutput = {
skeleton: string;
xliff: string;
data: {
// see Parameters.mdPath
markdownFileName: string;
// see Parameters.sklPath
skeletonFilename: string;
// see Paramters.source
srcLang: string;
// see Parameters.target
trgLang: string;
// extracted text segments
units: string[]
}
}
extract(ExtractParameters) => ExtractOutput
// xliff file string
type Xliff = string;
// skeleton file string
type Skeleton = string;
// callback function which will recieve results in the form of the composed markdown/yfm file string
type CallBack = <T>(err: Error, generated: ComposeOutput) => CallBackOutput
// callback function output
type CallbackOutput = any;
compose(xliff: Xliff, skeleton: Skeleton, cb: CallBack) => CallbackOutput
refer to cli extractor, extract tests for usage examples.
refer to cli composer for usage example.
supports:
supported by all commands
DEBUG
- enables failures logging to the filesystem
output_dir/.yfm2xliff.failures.log
.
continues to extract/compose
even if some failures occured in the process.extract text tokens for translation from all of the markup files inside the given directory into xliff.
yfm2xliff extract -i cloud-docs/ru -o cloud-docs-extracted
compose translated text units from all of the xliff files inside the given directory into translated markup.
USE_SOURCE
- uses originally extracted text tokens instead of the translated ones, thus giving you original non translated markup.yfm2xliff compose -i cloud-docs-extracted -o cloud-docs-translated
FAQs
text extraction from yfm syntax into xliff format
The npm package @doc-tools/yfm2xliff receives a total of 54 weekly downloads. As such, @doc-tools/yfm2xliff popularity was classified as not popular.
We found that @doc-tools/yfm2xliff 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.