@cucumber/gherkin-streams
Streams for reading Gherkin parser output
Last updated 5 months ago by GitHub Actions .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @cucumber/gherkin-streams 
SYNC missed versions from official npm registry.

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

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):

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(...)

Current Tags

  • 7.0.1                                ...           latest (5 months ago)

11 Versions

  • 7.0.1                                ...           5 months ago
  • 7.0.0                                ...           6 months ago
  • 6.0.0                                ...           a year ago
  • 5.0.1                                ...           5 years ago
  • 5.0.0                                ...           5 years ago
  • 4.0.0                                ...           5 years ago
  • 3.0.0                                ...           5 years ago
  • 2.0.2                                ...           6 years ago
  • 2.0.1                                ...           6 years ago
  • 2.0.0                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
Maintainers (1)
Downloads
Total 37
Today 0
This Week 0
This Month 17
Last Day 0
Last Week 14
Last Month 19
Dependencies (2)
Dev Dependencies (12)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE