sincecutoff.com
← all changes

k6 run supports a dependency manifest for default version constraints

Introduced 2026-02-10 · score 0.94

HOW TO USE IT

When an imported dependency has no version constraint in the script, set `K6_DEPENDENCIES_MANIFEST` to a JSON map of dependency names to constraints and run the script. The manifest supplies a default only for imported dependencies without an explicit version or `use k6 with` directive.

K6_DEPENDENCIES_MANIFEST='{"k6/x/faker": ">=v0.4.4"}' k6 run <script.js>

WHY THIS HELPS

Run a script with imported dependencies that lack explicit version constraints and need manifest-specified constraints.

BEFORE THIS CHANGE

An imported dependency without an explicit version defaults to `"*"`.

REQUIREMENTS AND LIMITATIONS

  • Version: v1.6.0
  • K6_DEPENDENCIES_MANIFEST: Environment variable containing a JSON object whose keys are dependency names and whose values are version constraints; it replaces the default `*` constraint when the imported dependency has no version defined in script pragmas.
  • dependency name (JSON key) (required): Name of a dependency imported by the script, such as `k6/x/faker`; entries do not affect dependencies the script does not import.
  • constraint (JSON value) (required): Version constraint to apply to that imported dependency when the script does not define its version using pragmas.
  • k6 run <script.js> (required): Runs the script with the manifest environment variable set in the invocation.
  • The manifest does not change anything for a dependency that is not imported by the script.
  • The manifest supplies defaults when a dependency has no version defined in the script using pragmas.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card