unified-stream

Streaming interface for unified processors

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
unified-stream
1102.0.02 years ago6 years agoMinified + gzip package size for unified-stream in KB

Readme

unified-stream
!Buildbuild-badgebuild !Coveragecoverage-badgecoverage !Downloadsdownloads-badgedownloads !Sponsorssponsors-badgecollective !Backersbackers-badgecollective !Chatchat-badgechat
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 install unified-stream
## Use

The below example pipes stdin, into an HTML formatter, to stdout.

```js
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.mdcontributing in unifiedjs/.githubhealth for ways to get started. See support.mdsupport for ways to get help.
This project has a code of conductcoc. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MITlicense © Titus Wormerauthor