Skip to content

Latest commit

 

History

History
41 lines (29 loc) · 970 Bytes

README.md

File metadata and controls

41 lines (29 loc) · 970 Bytes

@mscs/process

This is a library to handle child processes in typescript for node.

Installation

$ yarn add @mscs/process

Usage

Short example:

import { Process } from "@mscs/process";

async function runtime() {
    const listDirectoryProcess = new Process(["ls", "-lar"]);
    const exitCode = await listDirectoryProcess.run();

    if(listDirectoryProcess.isSuccessful()){
        const output = listDirectoryProcess.getOutput();
        // ...
    } else {
        const output = listDirectoryProcess.getErrorOutput();
        // ...    
    }
}

runtime().catch(error => {
    console.log(error);
    process.exit(1);
});

Important note

Since Symfony is, for good reason, a registered trademark, please take note that we are in no way associated with the Symfony brand or the SensioLabs organization. Therefore, we don't represent or speak for any of them.