Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ozee31 committed Aug 31, 2016
1 parent 958b3e3 commit 3eea7fe
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@ OhMyCache.Session.set('key', 'val')
### In html
```html
<html>
<head>
<head>
<!-- npm -->
<script src="node_modules/ohmycache/dist/bundle.js"></script>

<!-- bower -->
<script src="bower_components//ohmycache/dist/bundle.js"></script>

<!-- other method -->
<script src="lib-path/ohmycache/dist/bundle.js"></script>
</head>
<script src="lib-path/ohmycache/dist/bundle.js"></script>
</head>
</html>
```

Expand Down Expand Up @@ -156,6 +156,23 @@ OhMyCache.Local.set('key', 'value', {expire: 1})
OhMyCache.Local.get('key') // null
```

### GetAll
Get all items, remove all expired items
`getAll()`

#### Return
**Object** : all items {key: value, key2: value2...}

#### Exemples
```JS
OhMyCache.Local.set('k1', 'v1')
OhMyCache.Local.set('k2', 'v2', {readonly: true})
OhMyCache.Local.set('k3', 'v3', {expire: 1})

// sleep 2 secondes or more
OhMyCache.Local.getAll() // {k1: 'v1', k2: 'v2'}
```

### Remove
Remove item if don't readonly
`remove(key)`
Expand All @@ -182,10 +199,13 @@ OhMyCache.Local.get('key') // 'value'

### Clear
Remove all items
`clear()`
`clear(onlyExpired)`

#### Parameters
- {boolean} **onlyExpired** : if true remove only expired items else remove all items, default false

#### Return
true
**Boolean** : success

#### Exemples
```JS
Expand Down

0 comments on commit 3eea7fe

Please sign in to comment.