
Security News
libxml2 Maintainer Ends Embargoed Vulnerability Reports, Citing Unsustainable Burden
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
retext-stringify
Advanced tools
The retext-stringify package is a plugin for the retext ecosystem that serializes a syntax tree into a string. It is typically used in conjunction with other retext plugins to process natural language text and then convert the processed syntax tree back into a string format.
Basic Stringify
This code demonstrates the basic usage of retext-stringify. It processes a simple English sentence and converts the resulting syntax tree back into a string.
const retext = require('retext');
const stringify = require('retext-stringify');
const english = require('retext-english');
const report = require('vfile-reporter');
retext()
.use(english)
.use(stringify)
.process('This is a simple example.', function (err, file) {
if (err) throw err;
console.log(String(file));
console.error(report(file));
});
remark-stringify is a plugin for the remark ecosystem that serializes Markdown syntax trees into Markdown strings. It is similar to retext-stringify but is specifically designed for Markdown content.
rehype-stringify is a plugin for the rehype ecosystem that serializes HTML syntax trees into HTML strings. It is similar to retext-stringify but is specifically designed for HTML content.
mdast-util-to-string is a utility that converts an MDAST (Markdown Abstract Syntax Tree) node to a string. It is similar to retext-stringify but is focused on converting specific nodes rather than entire trees.
retext plugin to serialize natural language. Compiler for unified. Serializes nlcst syntax trees.
Support this effort and give back by sponsoring on OpenCollective!
Gatsby 🥇 |
Vercel 🥇 |
Netlify![]() |
Holloway |
ThemeIsle |
Boost Hub![]() |
Expo |
You? |
This package is ESM only:
Node 12+ is needed to use it and it must be import
ed instead of require
d.
npm:
npm install retext-stringify
import {unified} from 'unified'
import {stream} from 'unified-stream'
import retextEnglish from 'retext-english'
import retextStringify from 'retext-stringify'
import retextEmoji from 'retext-emoji'
const processor = unified()
.use(retextEnglish)
.use(retextEmoji, {convert: 'encode'})
.use(retextStringify)
process.stdin.pipe(stream(processor)).pipe(process.stdout)
This package exports no identifiers.
retextStringify
is the default export.
unified().use(retextStringify)
Serialize nlcst syntax trees. There is no configuration.
See contributing.md
in retextjs/.github
for ways
to get started.
See support.md
for ways to get help.
Ideas for new plugins and tools can be posted in retextjs/ideas
.
A curated list of awesome retext resources can be found in awesome retext.
This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.
FAQs
retext plugin to serialize prose
The npm package retext-stringify receives a total of 585,442 weekly downloads. As such, retext-stringify popularity was classified as popular.
We found that retext-stringify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.