<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Manjeet Thakur</title>
    <description>The latest articles on DEV Community by Manjeet Thakur (@manjeet_thakur).</description>
    <link>https://dev.to/manjeet_thakur</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3661326%2F1807744d-f5e1-44d1-b4ea-b2073a9013de.jpg</url>
      <title>DEV Community: Manjeet Thakur</title>
      <link>https://dev.to/manjeet_thakur</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/manjeet_thakur"/>
    <language>en</language>
    <item>
      <title>I built a small Node.js tool to detect unhandled promises</title>
      <dc:creator>Manjeet Thakur</dc:creator>
      <pubDate>Sun, 14 Dec 2025 13:20:51 +0000</pubDate>
      <link>https://dev.to/manjeet_thakur/i-built-a-small-nodejs-tool-to-detect-unhandled-promises-14ig</link>
      <guid>https://dev.to/manjeet_thakur/i-built-a-small-nodejs-tool-to-detect-unhandled-promises-14ig</guid>
      <description>&lt;p&gt;While working on Node.js projects, I kept running into a frustrating issue:&lt;br&gt;
a Promise wasn’t awaited, nothing threw an error, but parts of the app behaved strangely or tests just hung.&lt;br&gt;
After hitting this a few times, I decided to dig deeper and built a small tool to help me understand what was going on.&lt;br&gt;
What I built&lt;br&gt;
I created a small npm package called await-leak-detector.&lt;br&gt;
Its goal is simple:&lt;br&gt;
detect unhandled / floating Promises that can silently break async flows in Node.js.&lt;br&gt;
At the moment, the tool only tracks Promises created using new Promise().&lt;br&gt;
It does not yet support async/await or libraries like axios that return Promises — I’m actively working on extending it.&lt;br&gt;
This started mainly as a learning and debugging experiment, not as a fully polished production-ready tool.&lt;br&gt;
Why this exists&lt;br&gt;
Unhandled promises can be tricky:&lt;br&gt;
No error is thrown&lt;br&gt;
No stack trace points to the problem&lt;br&gt;
Tests may hang or behave inconsistently&lt;br&gt;
I wanted something that could help surface these issues during development, even if it’s just a starting point.&lt;br&gt;
Current limitations&lt;br&gt;
Being transparent about this:&lt;br&gt;
Only works for new Promise() right now&lt;br&gt;
Doesn’t cover async functions yet&lt;br&gt;
Not battle-tested in large production apps&lt;br&gt;
But it’s already been useful for me while debugging async code.&lt;br&gt;
What’s next&lt;br&gt;
I’m currently working on:&lt;br&gt;
Supporting async / await&lt;br&gt;
Handling Promises returned by libraries like axios&lt;br&gt;
Improving detection for real-world async patterns&lt;br&gt;
Try it out&lt;br&gt;
If you’ve faced issues with unhandled promises before, feel free to give it a try and share your feedback.&lt;br&gt;
npm / repo:&lt;br&gt;
👉 &lt;a href="https://www.npmjs.com/package/await-leak-detector" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/await-leak-detector&lt;/a&gt; , &lt;a href="https://github.com/Manjeet-singh-thakur/awaitly" rel="noopener noreferrer"&gt;https://github.com/Manjeet-singh-thakur/awaitly&lt;/a&gt;&lt;br&gt;
Suggestions, issues, or PRs are very welcome 🙂&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>opensource</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
