🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@cucumber/gherkin-streams

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cucumber/gherkin-streams

Streams for reading Gherkin parser output

latest
Source
npmnpm
Version
6.0.0
Version published
Weekly downloads
1.4M
6.4%
Maintainers
2
Weekly downloads
 
Created
Source

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

const { GherkinStreams } = require('@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):

const { GherkinStreams } = require('@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(...)

FAQs

Package last updated on 12 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts