@tulpep/leopardcreek-commandexecutor
Module to execute commads to operating system.
Last updated 7 months ago by ricardopolo .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @tulpep/leopardcreek-commandexecutor 
SYNC missed versions from official npm registry.

LeopardCreek Command Executor

Module for command executor.

Supported Operating Systems

  • Windows
  • Linux

How to Install it

npm i @tulpep/leopardcreek-commandexecutor

Available Methods:

spawnCommand()

Allows you to run commands on the consoles of operating systems.

Parameters

function spawnCommand(command, desiredTimeout, desiredMaxLength, parseResult = false)

command: hostname // command syntax
desiredTimeout: "" // optional Timeout, specify the maximum return time of the command
desiredMaxLength: "" // optional MaxLength, specify the size of the command return. 

Example return for Windows

    {   
        output: 'Tulpep-Comp',
        error: '',
        exitCode: 0,
        message: 'Tulpep-Comp' 
    }

Example return for Linux

    {   
        output: 'Lnx-Comp',
        error: '',
        exitCode: 0,
        message: 'Lnx-Comp' 
    }

How To Use it:

const exec = require('./index.js')();

async function testCommandExecutor() {
    return new Promise((resolve) => {
        exec.spawnCommand('hostname')
            .then(async (response) => {
                console.log(response);
                resolve(response);
            })
    });
};

const command = testCommandExecutor();

console.log(command);

Dependencies

Current Tags

  • 1.0.4                                ...           latest (7 months ago)

5 Versions

  • 1.0.4                                ...           7 months ago
  • 1.0.3                                ...           7 months ago
  • 1.0.2                                ...           7 months ago
  • 1.0.1                                ...           7 months ago
  • 1.0.0                                ...           7 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 5
Dependencies (2)
Dev Dependencies (4)

Copyright 2014 - 2016 © taobao.org |