merge-defaults

A recursive version of _.defaults.

npm install merge-defaults
41 downloads in the last day
757 downloads in the last week
3 160 downloads in the last month

merge-defaults

Implements a deep version of _.defaults.

Installation

$ npm install merge-defaults

Usage


var _ = require('lodash');

// Override basic `_.defaults`
_.defaults = require('merge-defaults');

// Or you can add it as a new method
_.mergeDefaults = require('merge-defaults');

Why?

This module is a temporary solution, until lodash has something similar in core that can be called as an atomic, single method. In the mean time, this is a hack to make our code more readable. i.e. I know what _.defaults means intuitively, but I have to look up _.partialRight.

License

MIT © Mike McNeil 2014

npm loves you