npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

exit

v0.1.2

Published

A replacement for process.exit that ensures stdio are fully drained before exiting.

Downloads

96,507,343

Readme

exit Build Status

A replacement for process.exit that ensures stdio are fully drained before exiting.

To make a long story short, if process.exit is called on Windows, script output is often truncated when pipe-redirecting stdout or stderr. This module attempts to work around this issue by waiting until those streams have been completely drained before actually calling process.exit.

See Node.js issue #3584 for further reference.

Tested in OS X 10.8, Windows 7 on Node.js 0.8.25 and 0.10.18.

Based on some code by @vladikoff.

Getting Started

Install the module with: npm install exit

var exit = require('exit');

// These lines should appear in the output, EVEN ON WINDOWS.
console.log("foo");
console.error("bar");

// process.exit(5);
exit(5);

// These lines shouldn't appear in the output.
console.log("foo");
console.error("bar");

Don't believe me? Try it for yourself.

In Windows, clone the repo and cd to the test\fixtures directory. The only difference between log.js and log-broken.js is that the former uses exit while the latter calls process.exit directly.

C:\node-exit\test\fixtures>node log.js 0 10 stdout stderr 2>&1 | find "std"
[stdout] testing 0
[stderr] testing 0
[stdout] testing 1
[stderr] testing 1
[stdout] testing 2
[stderr] testing 2
[stdout] testing 3
[stderr] testing 3
[stdout] testing 4
[stderr] testing 4
[stdout] testing 5
[stderr] testing 5
[stdout] testing 6
[stderr] testing 6
[stdout] testing 7
[stderr] testing 7
[stdout] testing 8
[stderr] testing 8
[stdout] testing 9
[stderr] testing 9

C:\node-exit\test\fixtures>node log-broken.js 0 10 stdout stderr 2>&1 | find "std"

C:\node-exit\test\fixtures>

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

2013-09-20 - v0.1.0 - Initial release.

License

Copyright (c) 2013 "Cowboy" Ben Alman
Licensed under the MIT license.