Nightmare Prom Memories

    gherkin-io
    TypeScript icon, indicating that this package has built-in type declarations

    1.1.2 • Public • Published

    gherkin-io

    Downloads Version@npm Version@git CI Docs

    Tool to read/write GHerkin feature files and work with Gherking AST

    Usage

    Read feature files

    The read function can be used to parse feature file(s) to AST.

    read(pattern: string): Promise<Document[]>

    In TypeScript:

    import {read, Document} from "gherkin-io";
    
    const documents: Document[] = await read("./features/*.feature");

    In JavaScript:

    const {read} = require("gherkin-io");
    const documents = await read("./features/*.feature");

    Write feature files

    The write function can be used to write an AST to a feature file.

    write(filePath: string, document: Document, options?: FormatterOptions): Promise<void>

    In TypeScript:

    import {Document, write, FormatterOptions} from "gherkin-io";
    const document: Document = new Document(/*...*/);
    const options: FormatterOptions = {/*...*/};
    await write("./test.feature", document, options);

    In JavaScript:

    const {write, Document} = require("gherkin-io");
    const document = new Document(/*...*/);
    const options = {/*...*/};
    await write("./test.feature", document, options);

    FormatterOptions is re-exported from gherkin-formatter.

    For detailed documentation see the TypeDocs documentation.

    Install

    npm i gherkin-io

    DownloadsWeekly Downloads

    7,407

    Version

    1.1.2

    License

    MIT

    Unpacked Size

    10.3 kB

    Total Files

    6

    Last publish

    Collaborators

    • judit-nahaj
    • monikalaszlo
    • rakur
    • sorosz89
    • szikszail
    • wgula