Browse Source

Docs: Updated to include new methods

master
Jytesh 3 years ago
committed by GitHub
parent
commit
0a65837231
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 23
      README.md

23
README.md

@ -173,21 +173,12 @@ const awesomeModule = new AwesomeModule({ cache: some3rdPartyStore });
## API
### new Keyv([uri], [options])
### new Keyv([options])
Returns a new Keyv instance.
The Keyv instance is also an `EventEmitter` that will emit an `'error'` event if the storage adapter connection fails.
### uri
Type: `String`<br>
Default: `undefined`
The connection string URI.
Merged into the options object as options.uri.
### options
Type: `Object`
@ -261,6 +252,10 @@ If set to true the raw DB object Keyv stores internally will be returned instead
This contains the TTL timestamp.
#### .has(key)
Returns a promise which resolves to a boolean, indicating existence of a key.
#### .delete(key)
Deletes an entry.
@ -273,6 +268,14 @@ Delete all entries in the current namespace.
Returns a promise which is resolved when the entries have been cleared.
```
When calling clear(), on a keyv instance with no namespace, nothing is done.
```
#### .iterator()
Returns an [Async Iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator), which iterates over all the keys in the namespace.
## License
**keyv** © [Microlink](https://microlink.io), Released under the [MIT](https://github.com/microlinkhq/keyv/blob/master/LICENSE.md) License.<br>

Loading…
Cancel
Save