Skip to main content
Module

x/drake/lib/utils.ts

Drake is a make-like task runner for Deno.
Go to Latest
import * as drake from "https://deno.land/x/drake@v1.6.0/lib/utils.ts";

Functions

Write an error message to to stderr and terminate execution.

Write the title and message to stderr if it is a TTY and the --debug command-line option was specified or the DRAKE_DEBUG shell environment variable is set.

Return a sorted array of normalized file names matching the wildcard glob patterns. Valid glob patterns are those supported by Deno's path library. Example: glob("tmp/*.ts", "lib/*.ts", "mod.ts");

Return true if path is that of a directory. Return false if it is not a directory or does not exist.

Return true if the path is that of a regular file. Return false if it is not a regular file or does not exist.

Log a message to stdout. Do not log the message if the --quiet command-line option is set.

Create directory.

Return true if path exists, otherwise return false.

Quote string array values with double-quotes then join them with a separator. Double-quote characters are escaped with a backspace. The separator defaults to a space character.

Read the entire contents of a file synchronously to a UTF-8 string.

Delete files matching the wildcard glob patterns. Example: remove("tmp/*.ts", "lib/*.ts", "mod.ts");

Execute commands asynchronously in the command shell.

Execute command in the command shell and return a promise for {code, output, error} (the exit code, the stdout output and the stderr output).

Wait ms milliseconds. Must be called with await.

Return FileInfo (or null if file does not exist).

Find and replace in text file synchronously. If the file contents is unchanged return false. If the contents has changed write it to the file and return true.

Returns the Drake version number string.

Write text to a file synchronously. If the file exists it will be overwritten. Returns true if a new file was created. Returns false if the file already exists.

Interfaces

shCapture API options.

sh API options.