Skip to content

Commit

Permalink
chore: update cjs usage
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Mar 21, 2022
1 parent a25fb01 commit da1301b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,18 @@ Leftmost arguments have more priority when assigning defaults.
- **source (Object):** The source object.

```js
const defu = require('defu')
import { defu } from 'defu'

console.log(defu({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }))
// => { a: { b: 2, c: 3 } }
```

### Using with CommonJS

```js
const { defu } = require('defu')
```

## Custom Merger

Sometimes default merging strategy is not desirable. Using `createDefu` we can create a custom instance with different merging strategy.
Expand Down

0 comments on commit da1301b

Please sign in to comment.