Skip to content

Commit 53c7b24

Browse files
committed
Add more examples into document
1 parent 40c449f commit 53c7b24

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,21 @@ yarn add quick-stable-stringify
1818

1919
## Examples
2020

21+
Node.JS with CommonJS:
22+
2123
```js
22-
var stringify = require("quick-stable-stringify");
23-
var obj = { c: 8, b: [{ z: 6, y: 5, x: 4 }, 7], a: 3 };
24+
const stringify = require("quick-stable-stringify");
25+
const obj = { c: 8, b: [{ z: 6, y: 5, x: 4 }, 7], a: 3 };
2426
console.log(stringify(obj));
2527
```
2628

27-
output:
29+
Typescript or modern Javascript environment:
2830

29-
```
30-
{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8}
31+
```ts
32+
import stringify from "quick-stable-stringify";
33+
34+
const obj = { c: 8, b: [{ z: 6, y: 5, x: 4 }, 7], a: 3 };
35+
console.log(stringify(obj));
3136
```
3237

3338
## Options

0 commit comments

Comments
 (0)