Comments (2)
Can we reliably just do process.binding('uv')?
Yes, but we probably shouldn't as they're trying to deprecate it: nodejs/node#2768 I think we should rather open an issue requesting a public API for what we need.
from execa.
they're trying to deprecate it ...
That is labeled as "stalled", and there are strong arguments for only preventing access to bindings which might be harmful (I doubt an errname lookup would count as harmful, but not sure what else the uv
binding does).
I think we should rather open an issue requesting a public API for what we need
Yes, absolutely. In the meantime let's just write a defensive wrapper around process.binding('uv')
so execa
will only blow up if we can't access the binding, and they have a negative exit code. (it's only needed for negative exit codes). That allows us to stay backward compatible and provide the errname until a public API is available.
Assuming they deprecate before providing a public alternative, we might also be able to extract it from util._errnoException
. It builds an error object from an exit code that has the errname lookup attached. That's obviously a private method, but we could just write more defensive wrappers around our access to it. That method is used liberally in the Node codebase, so no matter what, I think we will be able to hack a workable solution one way or the other until someone creates the "right way" to do it.
from execa.
Related Issues (20)
- breaking changes not included in v9 release notes HOT 5
- Promise-based IPC HOT 2
- Remove `execaCommand()`
- Deprecating old `ipc` option HOT 1
- The `stdin` and `stdout` options must not target a file path string that is the same. HOT 2
- Export `Execa` and `ExecaScript` types. HOT 2
- v9.1.0 possible bug HOT 4
- template syntax HOT 2
- Select specific IPC messages
- Avoid race conditions with IPC
- backup-file-in-package HOT 2
- Cannot set properties of null (setting 'peer') HOT 1
- 9.2.0 release post HOT 2
- execa with env option not working HOT 5
- Do not disconnect IPC on `error` event
- Not able to inject environment variables HOT 3
- Node.js engine version in package.json is not up-to-date HOT 6
- Document CLI utilities
- Subprocess is considered as failed exit when using `process.kill` on windows only HOT 6
- Graceful termination HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from execa.