Metreeca Gear
    Preparing search index...

    Module @metreeca/gear-json - v0.2.0

    JSON processing tasks.

    Parses JSON payloads, addresses the values they hold by path, retains the ones meeting the constraints a consumer states, and narrows them to the types it expects.

    @metreeca/gear-json

    npm

    JSON processing tasks for @metreeca/gear.

    Installation

    npm install @metreeca/gear       # the job execution API
    npm install @metreeca/gear-json # this package
    Important

    Node.js 22 or later is required.

    Warning

    TypeScript consumers must use "moduleResolution": "nodenext"/"node16"/"bundler" in tsconfig.json. The legacy "node" resolver is not supported.

    Usage

    Task Description
    json() JSON parser
    jpath() JSON path selector
    validate() JSON value validator

    Support

    • open an issue to report a problem or to suggest a new feature
    • start a discussion to ask a how-to question or to share an idea

    License

    This project is licensed under the Apache 2.0 License – see LICENSE file for details.

    JPath

    JSONPath-like selector over JSON values.

    jpath

    Creates a JSON path selector.

    json

    Creates a JSON parser.

    validate

    Creates a value validation task.

    boolean

    Narrows a JSON value to a boolean.

    number

    Narrows a JSON value to a number.

    string

    Narrows a JSON value to a string.

    Narrows a JSON value to a link.