file

package module
v1.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

README

xk6-file

k6 extension for writing files, implemented using the xk6 system.

Build

xk6 build v0.36.0 --with github.com/avitalique/xk6-file-sandbox-2@latest

Example

import file from 'k6/x/file';

const filepath = 'sample-output.txt';

export default function () {
    file.writeString(filepath, 'New file. First line.\n');
    file.appendString(filepath, `Second line. VU: ${__VU}  -  ITER: ${__ITER}`);
}

Run sample script

./k6 run sample-script.js

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FILE

type FILE struct{}

FILE is the k6 extension

func (*FILE) AppendString

func (*FILE) AppendString(path string, s string) error

Append string to file

func (*FILE) WriteString

func (*FILE) WriteString(path string, s string) error

Write string to file

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL