unified-stream
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

unified-stream

Build Coverage Downloads Sponsors Backers Chat

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 imported instead of required.

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.

License

MIT © Titus Wormer

Install

npm i unified-stream

DownloadsWeekly Downloads

1,942

Version

2.0.0

License

MIT

Unpacked Size

12 kB

Total Files

5

Last publish

Collaborators

  • wooorm