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.
mdast-util-to-nlcst
Advanced tools
Note You probably want to use remark-retext.
npm:
npm install mdast-util-to-nlcst
Dependencies:
var toNLCST = require('mdast-util-to-nlcst');
var inspect = require('unist-util-inspect');
var English = require('parse-english');
var remark = require('remark');
var vfile = require('vfile');
var file = vfile('Some *foo*sball.');
var tree = remark().parse(file);
var nlcst = toNLCST(tree, file, English);
console.log(inspect(nlcst));
Yields:
RootNode[1] (1:1-1:17, 0-16)
└─ ParagraphNode[1] (1:1-1:17, 0-16)
└─ SentenceNode[4] (1:1-1:17, 0-16)
├─ WordNode[1] (1:1-1:5, 0-4)
│ └─ TextNode: "Some" (1:1-1:5, 0-4)
├─ WhiteSpaceNode: " " (1:5-1:6, 4-5)
├─ WordNode[2] (1:7-1:16, 6-15)
│ ├─ TextNode: "foo" (1:7-1:10, 6-9)
│ └─ TextNode: "sball" (1:11-1:16, 10-15)
└─ PunctuationNode: "." (1:16-1:17, 15-16)
toNLCST(node, file, Parser)
Transform an MDAST syntax tree and corresponding virtual file into an NLCST tree.
node
(MDASTNode
) — Syntax tree (with positional
information);file
(VFile
);parser
(Function
)
— Constructor of an NLCST parser, such as
parse-english, parse-dutch,
or parse-latin.FAQs
mdast utility to transform to nlcst
The npm package mdast-util-to-nlcst receives a total of 93,186 weekly downloads. As such, mdast-util-to-nlcst popularity was classified as popular.
We found that mdast-util-to-nlcst demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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.