@synode/adapter-stream
v5.0.25
Published
Stream adapter for Synode
Maintainers
Readme
@synode/adapter-stream
Stream output adapter for Synode. Writes generated events to any Node.js writable stream.
Install
npm install @synode/adapter-streamRequires @synode/core as a peer dependency.
Usage
import { createWriteStream } from 'node:fs';
import { generate } from '@synode/core';
import { StreamAdapter } from '@synode/adapter-stream';
const stream = createWriteStream('./events.jsonl');
const adapter = new StreamAdapter(stream);
await generate(journey, { users: 100, adapter });
await adapter.close();Using with PassThrough
import { PassThrough } from 'node:stream';
const pass = new PassThrough();
const adapter = new StreamAdapter(pass, { format: 'jsonl' });
pass.on('data', (chunk) => {
console.log(chunk.toString());
});
await generate(journey, { users: 5, adapter });
await adapter.close();Options
| Option | Type | Default | Description |
| -------- | ------------------- | --------- | ---------------------------------------------------------------- |
| format | 'jsonl' \| 'json' | 'jsonl' | jsonl writes per event, json buffers all and writes on close |
The constructor takes a Writable stream as its first argument and an optional options object as the second.
Documentation
License
Proprietary -- see LICENSE for details.
Copyright © 2026 Digitl Cloud GmbH
