NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #1602 most downloaded on npm
Recursively assign default properties. Lightweight and Fast!
Last release 6 months ago
07 Apr 2026
Ships unpredictably
gaps range from 2 weeks to 2.2 years
Most releases are documented
notes for 18 of 29 stable releases
1 version withdrawn
withdrawn after publishing
8 years old
31 releases · first in 2019
compare changes 📦 Build Correct the types export entry ( #160 ) Export Defu types ( #157 ) ❤️ Contributors Jakub Michálek ( @J-Michalek ) Kricsleo ( @
types export entry (#160)One column per quarter.
compare changes 📦 Build Fix mixed types
Prevent prototype pollution via __proto__ in defaults
__proto__ in defaults (#156)Move isPlainObject to _utils to allow testing
Module type (#121)isPlainObject to _utils to allow testing (e922a16)isPlainObject logic more readable (e458b63)isPlainObject util (b24a213)Module type (#121)isPlainObject to _utils to allow testing (e922a16)isPlainObject logic more readable (e458b63)skipLipCheck for type tests (7c7a9a4)Fix the result of the array merging
Add node16 compatible type declaration
Nothing published for this version
types: constrain inferred types of Defu
Nothing published for this version
When merging arrays, defaults are last in order:
defu(['a', 'b'], ['c', 'd'])
// With v6+
['a', 'b', 'c', 'd']
// Before
['c', 'd', 'a', 'b']Before:
// With v6+
import { defu } from 'defu'
const { defu } = require('defu')
// Before
import defu from 'defu'
const defu = require('defu')Other utilities are also exported as named exports to be tree-shakable:
// instead of defu.fn
import { defuFn } from 'defu'
// Instead of defu.arrayFn
import { defuArrayFn } from 'defu'
// Instead of defu.extend
import { createDefu } from 'defu'import defu from 'defu' => import { defu } from 'defu'defu.fn => import { defuFn }defu.arrayFn => import { defuArrayFn }Nothing published for this version
Nothing published for this version
undefined values will be bypassed and not consistent behavior with defaults-deep anymore.
undefined values will be bypassed and not consistent behavior with defaults-deep anymore.Nothing published for this version
### ⚠ BREAKING CHANGES * module exports ### Features * module exports
switch back to bili for es5 support till fixing in siroc
types: correct type inference where merged types are same
add type inference for defu result
### Features - Add defu.arrayFn
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Support passing multiple defaults
Nothing published for this version
improve es5 compatibility (#2, #9)
<a name="0.0.2"></a>
### Bug Fixes - imrpove non-object handlers
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →