APIs
Builtin Tasks

Note: This page is automatically generated from the task definitions in task-defs (opens in a new tab) directory.

asString

Convert a value to a string.

Parameters

value: TaskValue

The value to convert to a string.

Return value

encoding.parseJson

Parse a JSON string into a JSON object.

Parameters

s: string

The JSON string to parse.

Return value

encoding.stringifyJson

Convert a JSON object into a JSON string.

Parameters

json: TaskValue

The JSON object to convert.

Return value

fs.copy

Copy files from source to destination.

If destination is a directory, the source file will be copied into that directory.

Parameters

src: string

Source file, or directory

dst: string

Destination file

Return value

fs.files

List files from the input glob or globs.

Parameters

globs: string[]

One or more globs to list files from.

options: object

Options for the glob operation.

Return value

fs.mkdir

Create a directory, including any parent directories that don't exist.

Parameters

path: string

Path to the directory to create.

Return value

fs.mktemp

Create a temporary directory.

Parameters

prefix: string

Prefix for the temporary directory name.

Return value

fs.read

Read the contents of a file.

Parameters

path: string

Path to the file to read.

Return value

fs.remove

Remove a file or directory.

Parameters

path: string

Path to the file or directory to remove.

Return value

fs.rename

Rename a file or directory.

Parameters

src: string

Path to the file or directory to rename.

dst: string

New path for the file or directory.

Return value

fs.write

Write data to a file.

Parameters

path: string

Path to the file to write.

data: Buffer

Data to write to the file.

Return value

path.basename

Get the basename of a path.

Parameters

path: string

The path to the file or directory.

Return value

path.dirname

Get the directory name of a path.

Parameters

path: string

The path to the file or directory.

Return value

string.endsWith

Check if a string ends with a given substring.

Parameters

s: string

The string to check.

substring: string

The substring to check for.

Return value

string.parseBigInt

Parse a string into a BigInt.

Parameters

s: string

The string to parse.

radix: integer

The radix to use for the parse. Defaults to 10.

Return value

string.parseFloat

Parse a string into a floating point number.

Parameters

s: string

The string to parse.

Return value

string.parseInt

Parse a string into an integer.

Parameters

s: string

The string to parse.

radix: integer

The radix to use for the parse. Defaults to 10.

Return value

string.replace

Replace all occurrences of a substring in a string.

Parameters

s: string

The string to search.

searchValue: string

The substring to search for.

replaceValue: string

The replacement string.

Return value

string.split

Split a string into an array of substrings.

Parameters

s: string

The string to split.

separator: string

The separator to use for splitting.

Return value

string.startsWith

Check if a string starts with a given substring.

Parameters

s: string

The string to check.

substring: string

The substring to check for.

Return value

string.toLowerCase

Convert a string to lower case.

Parameters

s: string

The string to convert.

Return value

string.toUpperCase

Convert a string to upper case.

Parameters

s: string

The string to convert.

Return value

string.trim

Trim whitespace from the beginning and end of a string.

Parameters

s: string

The string to trim.

Return value

string.trimEnd

Trim whitespace from the end of a string.

Parameters

s: string

The string to trim.

Return value

string.trimStart

Trim whitespace from the beginning of a string.

Parameters

s: string

The string to trim.

Return value

timer.sleep

Sleep for a specified number of milliseconds.

Parameters

ms: number

The number of milliseconds to sleep.

Return value