Skip to content

gnomejs/cmd-cli

Repository files navigation

@gnome/cmd-cli

logo Work less. Do more.

Overview

The cmd-cli module provides a simple way to execute windows command line scripts or files.

The module relies upon the @gnome/exec module and has the same basic usage as the Command and ShellCommand class.

Basic Usage

import { bash } from "@gnome/cmd-cli";

const cmd2 = await cmd("echo 'Hello, World!'", { 
        stdout: 'piped', 
        stderr: 'piped'
    });
console.log(await cmd2.text());
console.log(cmd2.code);

console.log(await cmd("echo 'Hello, World!'").text());

console.log(await cmd("test.cmd").text()); 

// runs bash command and writes directly to console
await cmd("echo 'I am alive'").run();

MIT License

About

The cmd-cli modules enables executing scripts or files for the windows command line

Resources

License

Stars

Watchers

Forks

Packages

No packages published