Skip to content

Commit 371ab1a

Browse files
Documentation instances distinction (#129)
* Documentation instances distinction Making it clear that formatters & console can be accessed only from static module. Issue #106 * naming consistency Co-authored-by: Nathan Bierema <nbierema@gmail.com> * reformat README Co-authored-by: Nathan Bierema <nbierema@gmail.com> --------- Co-authored-by: Nathan Bierema <nbierema@gmail.com>
1 parent 4cb5805 commit 371ab1a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,17 +180,20 @@ npm install jsondiffpatch
180180
```
181181

182182
```js
183-
var jsondiffpatch = require('jsondiffpatch').create(options);
183+
var jsondiffpatch = require('jsondiffpatch');
184+
var jsondiffpatchInstance = jsondiffpatch.create(options);
184185
```
185186

187+
Some properties are available only from static main module (e.g. formatters, console), so we need to keep the reference to it if we want to use them.
188+
186189
### browser
187190

188191
In a browser, you could load directly a bundle in `/dist`, eg. `/dist/jsondiffpatch.umd.js`.
189192

190193
## Options
191194

192195
```javascript
193-
var jsondiffpatch = require('jsondiffpatch').create({
196+
var jsondiffpatchInstance = require('jsondiffpatch').create({
194197
// used to match objects when diffing arrays, by default only === operator is used
195198
objectHash: function (obj) {
196199
// this function is used only to when objects are not equal by ref

0 commit comments

Comments
 (0)