cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (CB-10052) Improve superspawn to allow to handle spawned process io streams
Date Tue, 02 Feb 2016 11:08:39 GMT


ASF GitHub Bot commented on CB-10052:

Github user dblotsky commented on the pull request:
    @vladimir-kotikov you still need to subscribe a callback, just using `progress` instead
of `on("data")`. However using `progress` creates a *new* API, while using `on` leverages
a well-established existing API. I'd recommend just reusing what's already known by users
of Node APIs.

> Improve superspawn to allow to handle spawned process io streams
> ----------------------------------------------------------------
>                 Key: CB-10052
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: CordovaCommon
>    Affects Versions: 1.0.0
>            Reporter: Vladimir Kotikov
>            Assignee: Vladimir Kotikov
>             Fix For: 1.1.0
> Sometimes it is useful to process spawned process stdout and stderr in some way before
out this to console. The current implementation of superspawn doesn't give a way to do this.
One of the cases when this could be helpful - CB-9971 (see
for some discussion).
> The proposed approach is:
> 1. Add ability to accept any valid stdio configuration, just like the original child_process.spawn
does (
> 2. Give a way to caller to listen to stdout and stderr events. This might be implemented
as resultant promise progress notification:
> {code:JavaScript}
> spawn('mycommand', [], {stdio: 'pipe'})
> .progress(function (stdio){
>     if (stdio.stderr) {
>         console.error(stdio.stderr);
>     }
> })
> .then(function(result){
>     // do other stuff
> })
> {code}
> Another option is to return na object that implements both EventEmitter and Promise interfaces,
so anybody might subscribe to its events.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message