Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Execute child.stdout.on before child.on("exit")  #224

Copy link
Copy link
@orbatschow

Description

@orbatschow
Issue body actions
var shell = require('shelljs');

var child = shell.exec('node --version', {silent:true, async:true});

child.stdout.on('data', function(data) {
    console.log(data);
});

child.on("exit", function(code) {
    console.log(code);
});

child.on("error", function (error) {
console.log(error);
});

The output of this command is :

0
v1.0.4

What do i have to do, to make shelljs return all data immediately and before on exit is executed ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    execIssues specific to the shell.exec() APIIssues specific to the shell.exec() APIfixBug/defect, or a fix for such a problemBug/defect, or a fix for such a problem

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.