Skip to content

A k6 extension enables to encode and decode YAML values

License

Notifications You must be signed in to change notification settings

szkiba/xk6-yaml

Repository files navigation

xk6-yaml

A k6 extension enables k6 tests to comfortably encode and decode YAML values.

The underlying implementation is https://github.com/go-yaml/yaml

Built for k6 using xk6.

Usage

Import an entire module's contents:

import * as YAML from "k6/x/yaml";

Import a single export from a module:

import { parse } from "k6/x/yaml";

API

Functions:

For complete API documentation click here!

Build

To build a k6 binary with this extension, first ensure you have the prerequisites:

Then:

  1. Install xk6:
$ go install go.k6.io/xk6/cmd/xk6@latest
  1. Build the binary:
$ xk6 build --with github.com/szkiba/xk6-yaml@latest