Skip to content

Latest commit

 

History

History
80 lines (55 loc) · 3.68 KB

index.md

File metadata and controls

80 lines (55 loc) · 3.68 KB

Underscore-contrib (0.3.0)

The brass buckles on Underscore's utility belt - a contributors' library for Underscore.

Introduction

Places

Why underscore-contrib?

While Underscore provides a bevy of useful tools to support functional programming in JavaScript, it can't (and shouldn't) be everything to everyone. Underscore-contrib is intended as a home for functions that, for various reasons, don't belong in Underscore proper. In particular, it aims to be:

  • a home for functions that are limited in scope, but solve certain point problems, and
  • a proving ground for features that belong in Underscore proper, but need some advocacy and/or evolution (or devolution) to get them there.

Use

In the Browser

First, you'll need Underscore version 1.6.0 or higher. Then you can grab the relevant underscore-contrib sub-libraries and simply add something like the following to your pages:

<script type="text/javascript" src="underscore.js"></script>
<script type="text/javascript" src="underscore.object.builders.js"></script>

At the moment there are no cross-contrib dependencies (i.e. each sub-library can stand by itself), but that may change in the future.

In Node.js

Using contrib in Node is very simple. Just install it with npm:

npm install underscore-contrib --save

Then require it within your project like so:

var _ = require('underscore-contrib');

The _ variable will be a copy of Underscore with contrib's methods already mixed in.

License

_.contrib is open sourced under the MIT license.

Sub-libraries

The _.contrib library currently contains a number of related capabilities, aggregated into the following files.

The links above are to the annotated source code. Full-blown _.contrib documentation is in the works. Contributors welcomed.