@rnx-kit/tools-shell

0.2.0 • Public • Published

@rnx-kit/tools-shell

Build npm version

@rnx-kit/tools-shell is a collection of functions for writing shell scripts.

You can import the entire package, or, to save space, import individual categories:

import * as tools from "@rnx-kit/tools-shell";

// Alternatively...
import * as asyncTools from "@rnx-kit/tools-shell/async";
import * as commandTools from "@rnx-kit/tools-shell/command";
Category Function Description
async idle(ms) Sleep for a specified numer of milliseconds.
async once(func) Wraps the function, making sure it only gets called once.
async retry(func, retries, counter) Calls the specified function, retrying up to specified number of times as long as the result is null.
async withRetry(func, retries, counter) Calls the specified function, retrying up to specified number of times as long as the function throws.
command ensure(result, message) Throws if the result of the process is non-zero.
command ensureInstalled(check, message) Throws if the provided command fails.
command makeCommand(command, userOptions) Creates an async function for calling the specified command.
command makeCommandSync(command) Creates a synchronous function for calling the specified command.

/@rnx-kit/tools-shell/

    Package Sidebar

    Install

    npm i @rnx-kit/tools-shell

    Weekly Downloads

    117

    Version

    0.2.0

    License

    MIT

    Unpacked Size

    14 kB

    Total Files

    11

    Last publish

    Collaborators

    • kelset
    • hansenyy
    • jasonvmorse
    • acoates
    • rnbot
    • tido64
    • rnsdkbot