unified-stream
Streaming interface to unified processors.
Note that the interface is streaming, but the code buffers.
Install
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 unified-stream
Use
The below example pipes stdin, into an HTML formatter, to stdout.
import {stream} from 'unified-stream'
import {unified} from 'unified'
import rehypeParse from 'rehype-parse'
import rehypeFormat from 'rehype-format'
import rehypeStringify from 'rehype-stringify'
process.stdin
.pipe(
stream(unified().use(rehypeParse).use(rehypeFormat).use(rehypeStringify))
)
.pipe(process.stdout)
API
This package exports the following identifiers: stream
.
There is no default export.
stream(processor)
Create a readable/writable stream that transforms with processor
.
Contribute
See contributing.md
in unifiedjs/.github
for ways
to get started.
See support.md
for ways to get help.
This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.