Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

State defaults and correct typo #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ cache.set('my key', { foo: 'bar' }, function (error) {

### Cacheman([name, [options]])

Create `cacheman` instance. It accepts an `name`(optional) and `options`(optional). `options` can contain `ttl` to set the default "Time To Live" in seconds, `delimiter` to change the delimiter used for array keys (default: `':'`), `Promise` can set a Promise library to use for promises, `engine` that could be "memory", "in file", "redis" or "mongo", and the corresponding engine options that can be passed like `port`, `host`, etc.
Create `cacheman` instance. It accepts an `name`(optional) and `options`(optional). `options` can contain `ttl` to set the default "Time To Live" in seconds (default: `60s`), `delimiter` to change the delimiter used for array keys (default: `':'`), `Promise` can set a Promise library to use for promises, `engine` that could be "memory", "in file", "redis" or "mongo" (default: `memory`), and the corresponding engine options that can be passed like `port`, `host`, etc.

You can also pass an already initialized client `engine` as valid engine so you can re-use among multiple cacheman instances.

Expand Down Expand Up @@ -109,7 +109,7 @@ cache.set('foo', { a: 'bar' }, 60, function (err, value) {
});
```

You can also use humman readable values for `ttl` like: `1s`, `1m`, etc. Check out the [ms](https://github.com/guille/ms.js) project for additional information on supported formats.
You can also use human readable values for `ttl` like: `1s`, `1m`, etc. Check out the [ms](https://github.com/guille/ms.js) project for additional information on supported formats.

```javascript
// key will expire in 45 seconds
Expand Down