
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
mdast-util-to-string
Advanced tools
remark utility to get the plain text content of an mdast node.
npm:
npm install mdast-util-to-string
mdast-util-to-string is also available for duo, and as an AMD, CommonJS, and globals module, uncompressed and compressed.
/*
* Dependencies.
*/
var remark = require('remark');
var toString = require('mdast-util-to-string');
/*
* AST.
*/
var ast = remark.parse('Some *emphasis*, **strongness**, and `code`.');
toString(ast);
// 'Some emphasis, strongness, and code.'
toString(node)Get the text content of a node.
The algorithm checks value of node, then alt, and finally title.
If no value is found, the algorithm checks the children of node and
joins them (without spaces or newlines).
This is not a markdown to plain-text library. Use strip-markdown for that.
Parameters:
node (Node).Returns: string — text representation of node.
Similar to mdast-util-to-string, hast-util-to-text is a utility for converting HAST (Hypertext Abstract Syntax Tree) nodes to plain text strings. While mdast-util-to-string works with markdown, hast-util-to-text is used for HTML content.
This package is similar in that it also operates on AST nodes, specifically UNIST nodes, to stringify the position of a node. It's different from mdast-util-to-string as it focuses on the position rather than extracting the text content.
Remark-stringify is part of the remark ecosystem and is used to serialize markdown. It is similar to mdast-util-to-string in that it deals with markdown content, but it focuses on converting the entire MDAST back to a markdown string, rather than extracting plain text.
FAQs
mdast utility to get the plain text content of a node
The npm package mdast-util-to-string receives a total of 8,505,143 weekly downloads. As such, mdast-util-to-string popularity was classified as popular.
We found that mdast-util-to-string demonstrated a not healthy version release cadence and project activity because the last version was released 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.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.