fynjs API
    Preparing search index...

    Interface Xsh

    interface Xsh {
        env: {
            get: (name: string, valWhenUndef?: string) => string;
            getAsBool: (name: string, valWhenUndef?: unknown) => boolean;
            getAsInt: (name: string, valWhenUndef?: unknown) => number;
        };
        envPath: {
            add: (p?: string, env?: string | EnvContainer) => string;
            addToEnd: (p?: string, env?: string | EnvContainer) => string;
            addToFront: (p: string, env?: string | EnvContainer) => string;
            envKey: string;
            findEnvKey: (env: EnvContainer, key?: string) => string;
        };
        exec: {
            (...args: (boolean | ExecOptions | ExecFragment)[]): ExecResult;
            (...args: [...ExecArg[], ExecCallback]): ChildProcess;
        };
        mkCmd: (...args: (string | string[])[]) => string;
        pathCwd: {
            remove: (p: string, flags?: string, stripSlash?: boolean) => string;
            replace: (p: string, str?: string | false, flags?: string) => string;
        };
        pathCwdNm: {
            remove: (p: string, flags?: string) => string;
            replace: (p: string, str?: string | false, flags?: string) => string;
        };
        popd: () => string;
        Promise: PromiseConstructor;
        pushd: (dir: string) => string;
    }
    Index
    env: {
        get: (name: string, valWhenUndef?: string) => string;
        getAsBool: (name: string, valWhenUndef?: unknown) => boolean;
        getAsInt: (name: string, valWhenUndef?: unknown) => number;
    }

    Type Declaration

    • get: (name: string, valWhenUndef?: string) => string
    • getAsBool: (name: string, valWhenUndef?: unknown) => boolean
    • getAsInt: (name: string, valWhenUndef?: unknown) => number
    envPath: {
        add: (p?: string, env?: string | EnvContainer) => string;
        addToEnd: (p?: string, env?: string | EnvContainer) => string;
        addToFront: (p: string, env?: string | EnvContainer) => string;
        envKey: string;
        findEnvKey: (env: EnvContainer, key?: string) => string;
    }

    Type Declaration

    • add: (p?: string, env?: string | EnvContainer) => string
    • addToEnd: (p?: string, env?: string | EnvContainer) => string
    • addToFront: (p: string, env?: string | EnvContainer) => string
    • envKey: string
    • findEnvKey: (env: EnvContainer, key?: string) => string
    exec: {
        (...args: (boolean | ExecOptions | ExecFragment)[]): ExecResult;
        (...args: [...ExecArg[], ExecCallback]): ChildProcess;
    }

    Type Declaration

      • (...args: (boolean | ExecOptions | ExecFragment)[]): ExecResult
      • Execute a shell command with Node.js child_process.exec.

        Arguments can be any mix of command fragments (strings / arrays of strings, joined with " "), one options object or boolean (silent shorthand) as the first, last, or second to last argument, and a callback as the last argument.

        Returns the child process when a callback is given, else an ExecResult thenable.

        Parameters

        Returns ExecResult

      • (...args: [...ExecArg[], ExecCallback]): ChildProcess
      • Execute a shell command with Node.js child_process.exec.

        Arguments can be any mix of command fragments (strings / arrays of strings, joined with " "), one options object or boolean (silent shorthand) as the first, last, or second to last argument, and a callback as the last argument.

        Returns the child process when a callback is given, else an ExecResult thenable.

        Parameters

        Returns ChildProcess

    mkCmd: (...args: (string | string[])[]) => string

    Type Declaration

      • (...args: (string | string[])[]): string
      • Make a command string: every argument, string or array of strings, contributes its words in order, joined with " ".

        Parameters

        • ...args: (string | string[])[]

        Returns string

    pathCwd: {
        remove: (p: string, flags?: string, stripSlash?: boolean) => string;
        replace: (p: string, str?: string | false, flags?: string) => string;
    }

    Type Declaration

    • remove: (p: string, flags?: string, stripSlash?: boolean) => string
    • replace: (p: string, str?: string | false, flags?: string) => string
    pathCwdNm: {
        remove: (p: string, flags?: string) => string;
        replace: (p: string, str?: string | false, flags?: string) => string;
    }

    Type Declaration

    • remove: (p: string, flags?: string) => string
    • replace: (p: string, str?: string | false, flags?: string) => string
    popd: () => string

    Type Declaration

      • (): string
      • chdir back to the directory most recently saved by pushd.

        Returns string

    Promise: PromiseConstructor

    Promise implementation used by exec - set to null to restore native Promise

    pushd: (dir: string) => string

    Type Declaration

      • (dir: string): string
      • Save the current working directory on a stack, then chdir into dir.

        Parameters

        • dir: string

        Returns string