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

dry-underscore

v0.24.2

Published

The DRY Underscore Library

Readme

dry: underscore library

Introduction

This is a heavily augmented version of underscore. It is the core library that is in heavy use in the dry framework. It has a server side version, and a client side version. Certain libraries don't exist both places because it wouldn't make sense, or the core functionality isn't supported by browsers: _.fs for example. If a library exists on the client side, the semantics are exactly the same as the server side version. Most of the time it's the exact same code, sometimes, like _.http the semantics are the same, but the underlying library is different. This lets us write code that works both places more easily.

Differences from underscore

_.each iterates properties of functions, as if they were objects (they are) instead of treating them as arrays (which they are not). _.max and _.min return different things, and operate slightly differently. Like you can _.min and _.max strings, because that makes sense, and it returns null if it doens't find anything.

Coding Style (coming soon)

We support both _.camelCaseFunctionNames and _.underscored_function_names, we prefer the latter: isIllicitIgloo vs. is_illicit_igloo, but we know we're the minority. We avoid the problem all together when possible, sometimes we can't, so we provide both, so we don't mess up your consistent style. We won't support _.PascalCase (ask me about it sometime), and we don't PascalCase our classes, because sometimes functions return classes, and the distinction doesn't matter.

Testing

We shoot for 100% coverage, we use tamejs in some of our code, so until we punchup a coverage tool that instruments properly, we're flying a little blind. We test the client side functions when they differ from the server side functions in phantomjs, and you can run the whole kit and kaboodle with ./run-tests.

_.http (http request)

Introduction

Basically I hate all the other http request libraries I've seen. I really just want strings in, strings out. I hate content type parsers. They always cause problems.

This works on both the server and client sides, with the exact same api. We don't deliver the body in pieces, we deliver it in one chunk.

_.http.get("http://www.google.com", function(err, res, body){
    ok(res.body === body);
});
_.http.post("http://www.google.com", "some data", function(err, res, body){
    ok(res.body === body);
});
var writer = _.http.post("http://www.google.com", function(err, res, body){
    ok(res.body === body);
});

writer.write("some");
writer.write("data");

writer.end();

License

See the LICENSE file in the root of the repo for license information.