# @cucumber/gherkin-streams

> Streams for reading Gherkin parser output

Latest version **7.0.1** (published 2026-06-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @cucumber/gherkin-streams
pnpm add @cucumber/gherkin-streams
yarn add @cucumber/gherkin-streams
bun add @cucumber/gherkin-streams
```

Provides the command `gherkin-javascript`.

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 7.0.1 |
| Published | 2026-06-20 |
| First published | 2021-03-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 43.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 3 |
| Author | Cucumber Limited |
| Maintainers | cukebot |

## Links

- npm: https://www.npmjs.com/package/@cucumber/gherkin-streams
- Repository: https://github.com/cucumber/gherkin-streams
- Homepage: https://github.com/cucumber/gherkin-streams#readme
- Issues: https://github.com/cucumber/gherkin-streams/issues
- npm.io page: https://npm.io/package/@cucumber/gherkin-streams

## Dependencies (2)

- [commander](https://npm.io/package/commander.md) 15.0.0
- [source-map-support](https://npm.io/package/source-map-support.md) 0.5.21

## Recent versions

- 7.0.1 (latest) — 2026-06-20
- 7.0.0 — 2026-06-10
- 6.0.0 — 2025-09-12
- 5.0.1 — 2022-03-31
- 5.0.0 — 2022-03-07
- 4.0.0 — 2021-09-01
- 3.0.0 — 2021-07-08
- 2.0.2 — 2021-05-17
- 2.0.1 — 2021-05-17
- 2.0.0 — 2021-05-15
- 1.0.0 — 2021-03-24

## README

# Gherkin Streams

This module contains utilities to use the Gherkin library with streams.

## Installation

`gherkin-streams` has 3 peer dependencies: `@cucumber/gherkin`, `@cucumber/messages`
and `@cucumber/message-streams`.

You need to have `@cucumber/gherkin` and`@cucumber/message-streams` in your dependencies,
`@cucumber/messages` is actually installed automatically with `@cucumber/gherkin`.

    npm install @cucumber/gherkin-streams @cucumber/gherkin @cucumber/message-streams

## Usage

```javascript
import { GherkinStreams } from '@cucumber/gherkin-streams'

const options = {
  includeSource: true,
  includeGherkinDocument: true,
  includePickles: true,
}
const stream = GherkinStreams.fromPaths(['features/hello.feature'])

// Pipe the stream to another stream that can read messages.
stream.pipe(...)
```

### Shortening URIs with `relativeTo`

You can include `relativeTo` option to avoid emitting longer or absolute URIs, instead making them only relative to the current working directory (or whatever makes sense for your use case):

```javascript
import { GherkinStreams } from '@cucumber/gherkin-streams'

// imagine `discoverPaths()` is a function that returns absolute paths
const paths = discoverPaths();
const options = {
  includeSource: true,
  includeGherkinDocument: true,
  includePickles: true,
  relativeTo: process.cwd()
}
const stream = GherkinStreams.fromPaths(paths)

// Pipe the stream to another stream that can read messages.
stream.pipe(...)
```

---
_Source: https://npm.io/package/@cucumber/gherkin-streams · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
