Skip to content

Commit

Permalink
add a simple readme
Browse files Browse the repository at this point in the history
  • Loading branch information
chee committed Feb 1, 2017
1 parent ff209c6 commit 3577f9f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
@@ -0,0 +1,20 @@
# object with default value

```js
const objectDefault = require('object-with-default-value')

const lol = objectDefault({a: 1, b: 2, c: 3}, 100)

console.log(lol.a) // 1
console.log(lol.b) // 2
console.log(lol.wow) // 100
```

you can still set things like normal:

```js
console.log(lol.dog) // 100
lol.dog = 'henry'
console.log(lol.dog) // "henry"
```

0 comments on commit 3577f9f

Please sign in to comment.