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 🙏

© 2025 – Pkg Stats / Ryan Hefner

std-pour

v1.1.0

Published

Promise-based subprocess execution that writes output in real-time.

Downloads

3,412

Readme

std-pour

Promise-based subprocess execution that writes output in real-time. Go ahead, pour yourself a command 🍺.

Usage

This library is great for chaining commands using promises, but seeing the output in real-time.

const { pour } = require('std-pour');
pour('ping', ['8.8.8.8', '-c', '4']).then(code => console.log(`Error Code: ${code}`));

This module wraps child_process.spawn so should be drop-in replacement (function signature-compatable) for any code that is using it.

const { spawn } = require('child_process');
const { pour } = require('std-pour');
const options = {
    cwd: '/usr',
    env: process.env
};
const ls1 = spawn('ls', ['-al'], options);
const ls2 = pour('ls', ['-al'], options);

API

pour/pourConsole

pour is an alias for pourConsole.

function pour (cmd, args, opts, stdout = process.stdout, stderr = process.stderr)
function pourConsole (cmd, args, opts, stdout = process.stdout, stderr = process.stderr)

The command, without any of the optional arguments supplied, will default to writing the cmd's stdout/stderr to process.stdout/process.stderr.

pourFile

function pourFile (cmd, args, opts, stdoutFile, stderrFile = stdoutFile)

pourFile is useful for writing command output to a file. stdoutFile should be a path to a file that will be created for you. Likewise, if you want stdout written to a seperate file, you can supply the path to a file which will be created for logging stdout.

Windows Users

If you're on Windows Node.js does some funny business when handling quotes that may result in you issuing a command that you know works from the console, but does not when run in Node. For example the following should work:

pour('ping', ['"8.8.8.8"'], {});

but fails with the following:

Ping request could not find host "8.8.8.8". Please check the name and try again.

There's a fantastically undocumented option windowsVerbatimArguments for handling quotes/similar that seems to do the trick, just be sure to add the following to your opts object:

const opts = {
    windowsVerbatimArguments: true
}

and your command should be back in business.

 pour('ping', ['"8.8.8.8"'], { windowsVerbatimArguments: true });

Honorable-Mentions

This library is inspired by (but in no way affiliated with or endorsed by) the great folks and food at The Standard Pour.