Skip to content

Instantly share code, notes, and snippets.

@bnoordhuis
Created January 11, 2012 12:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bnoordhuis/70252aefa4d34899f38e to your computer and use it in GitHub Desktop.
Save bnoordhuis/70252aefa4d34899f38e to your computer and use it in GitHub Desktop.
diff --git a/src/node.js b/src/node.js
index 15cccb6..5c83462 100644
--- a/src/node.js
+++ b/src/node.js
@@ -326,6 +326,10 @@
// For supporting legacy API we put the FD here.
stdin.fd = fd;
+ // Unref the handle so it doesn't keep the event loop alive.
+ // .resume() refs the handle and the user needs to call that anyway.
+ if (stdin._handle) stdin._handle.unref();
+
return stdin;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment