Skip to content
Draft
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
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ output:

# methods

``` js
var stringify = require('json-stable-stringify')
```

## var str = stringify(obj, opts)

Return a deterministic stringified string `str` from the object `obj`.
Expand Down Expand Up @@ -139,6 +135,16 @@ With [npm](https://npmjs.org) do:
npm install json-stable-stringify
```

CommonJS example:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
CommonJS example:
CJS example:

``` js
var stringify = require('json-stable-stringify')
Copy link
Owner

@ljharb ljharb Dec 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var stringify = require('json-stable-stringify')
const stringify = require('json-stable-stringify');

```

Es6 example:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Es6 example:
ESM example:

``` js
import stringify from 'json-stable-stringify'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import stringify from 'json-stable-stringify'
import stringify from 'json-stable-stringify';

```

# license

MIT
Expand Down