Giter VIP home page Giter VIP logo

cross-spawn-promise's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar malept avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

git-rz

cross-spawn-promise's Issues

Provide callbacks to format the resolved data, as well as the command for logging

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Problem description

As a user I require the ability to capture stderr instead of stdout. More generally I require the ability to provide my own callback to resolve the promise, using data from both stdout and stderr.

Similarly, I have a need to override the default rendering of the command within error objects, in addition to what value goes to the logger. Use cases here include redacting sensitive info as well as allowing the user to render in a way that is more visible and useful. The default rendering does not put quotation marks around arg array elements, as example, and I'd prefer to have those, as well as output to more than one line. My ideal implementation would be more like JSON.stringify(args, null, 2).

Proposed solution

The solution is in my fork, where I have added options for formatOutputCallback, stringifyCommandCallback, and returnStderr.

The changes should necessitate a minor version change bump.

I've updated the readme and tests. I'll need to rebase, but first I'm looking for any feedback.

Alternatives considered

n/a

Additional information

No response

childProcess not accessible

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Problem description

When a spawn is launched in background, i've no way to kill it from the parent level.
cross-spawn-promise original npm library was storing in the promise object the childProcess id to let it be doable

const promise crossSpawnPromise.spawn('xxxxxx');

promise.childProcess.kill()

Proposed solution

N/A

Alternatives considered

N/A

Additional information

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.