Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix pino-abstract-transport and mention hwp #1174

Merged
merged 1 commit into from
Oct 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/transports.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ a simple utility to parse each line. Its usage is highly recommended.
You can see an example using a async iterator with ESM:

```js
import build from 'pino-abstract-stream'
import build from 'pino-abstract-transport'

export default async function (opts) {
return build(async function (source) {
Expand All @@ -130,7 +130,7 @@ or using Node.js streams and CommonJS:
```js
'use strict'

const build = require('pino-abstract-stream')
const build = require('pino-abstract-transport')

module.exports = function (opts) {
return build(function (source) {
Expand All @@ -143,6 +143,8 @@ module.exports = function (opts) {

(It is possible to use the async iterators with CommonJS and streams with ESM.)

To consume async iterators in batches, consider using the [hwp](https://github.com/mcollina/hwp) library.

### Creating a transport pipeline

As an example, the following transport returns a `Transform` stream:
Expand Down