Skip to content

Commit 18409ce

Browse files
committed
Update readme
1 parent 32d4dca commit 18409ce

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

README.md

+13-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Schema API Client for NodeJS [![Build Status](https://travis-ci.org/schemaio/schema-node-client.png?branch=master)](https://travis-ci.org/schemaio/schema-node-client)
22

3-
Build and scale ecommerce with Schema. Create a free account at <https://schema.io>
3+
Build and scale ecommerce with Schema. Create your account at <https://schema.io>
44

55
## Install
66

@@ -9,30 +9,30 @@ Build and scale ecommerce with Schema. Create a free account at <https://schema.
99
## Connect
1010

1111
```javascript
12-
var Schema = require('schema-client');
12+
const Schema = require('schema-client');
1313

14-
var client = new Schema.Client('<client-id>', '<client-key>');
14+
const client = new Schema.Client('<client-id>', '<client-key>');
1515
```
1616

1717
## Usage
1818

1919
```javascript
20-
client.get('/products', {active: true}, function(err, products) {
21-
if (err) {
22-
// handle error
23-
return;
24-
}
20+
client.get('/products', { active: true }).then(products => {
2521
console.log(products);
22+
}).catch(err => {
23+
// handle error
2624
});
2725
```
2826

29-
#### With promises
27+
## Caching
28+
29+
As of v3, this client provides in-memory caching enabled by default. It uses a version clocking protocol that means you never have to worry about stale cache, and collections that don't change frequently, such as products, will always return from cache when possible.
30+
31+
To disable caching behavior, initialize the client with `cache: false`.
3032

3133
```javascript
32-
client.get('/products', {active: true}).then(function(products) {
33-
console.log(products);
34-
}).catch(function(err) {
35-
// handle error
34+
new Schema.Client('<client-id>', '<client-key>', {
35+
cache: false,
3636
});
3737
```
3838

@@ -47,4 +47,3 @@ Pull requests are welcome
4747
## License
4848

4949
MIT
50-

0 commit comments

Comments
 (0)