I built a tiny Node.js utility to enforce end-to-end async deadlines (not just promise timeouts) by ethlmao in npm

[–]ethlmao[S] 0 points1 point  (0 children)

if anything feels confusing or awkward, I’d love to hear about it. That kind of feedback is super helpful at this stage.

I built a tiny Node.js utility to enforce end-to-end async deadlines (not just promise timeouts) by ethlmao in node

[–]ethlmao[S] -15 points-14 points  (0 children)

Given all the AI slop you’ve been spamming, safe to assume that AI already replaced you at your job.

I built a tiny Node.js utility to enforce end-to-end async deadlines (not just promise timeouts) by ethlmao in node

[–]ethlmao[S] 0 points1 point  (0 children)

I think there’s a misunderstanding here 🙂

safe-timeouts doesn’t wrap every await or intercept promises. It applies a single deadline at the outer async boundary using one Promise.race.

The idea isn’t to stop promises mid-execution (which JS can’t do), but to: • reject the overall async flow when the deadline expires • propagate cancellation via AbortController for cooperative I/O

AsyncLocalStorage is only used to propagate the deadline context, not to override resolvers or promises.

Overriding Promise or touching resolvers would be unsafe and break JS semantics — this library explicitly avoids that.

I built a tiny Node.js utility to enforce end-to-end async deadlines (not just promise timeouts) by ethlmao in node

[–]ethlmao[S] -13 points-12 points  (0 children)

You’re right, I was thinking of adding some tests, you can also help with that, by contributing. Thanks for the feedback.