You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This package turns a unified processor into a (duplex) Node.js stream.
👉 Note: the interface is streaming but the code buffers.
When should I use this?
You can use this if you have to use Node streams and are integrating with
unified.
As the code actually buffers, in almost all cases, you can use unified itself.
Install
This package is ESM only.
In Node.js (version 16+), install with npm:
importprocessfrom'node:process'importrehypeFormatfrom'rehype-format'importrehypeParsefrom'rehype-parse'importrehypeStringifyfrom'rehype-stringify'import{unified}from'unified'import{stream}from'unified-stream'// Pipe stdin, into an HTML formatter, to stdout.process.stdin.pipe(stream(unified().use(rehypeParse).use(rehypeFormat).use(rehypeStringify))).pipe(process.stdout)
API
This package exports the identifier stream.
There is no default export.
stream(processor)
Create a duplex (readable and writable) stream that transforms with
processor.
Projects maintained by the unified collective are compatible with maintained
versions of Node.js.
When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line, unified-stream@^3,
compatible with Node.js 16.