You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-44Lines changed: 25 additions & 44 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,69 +9,50 @@
9
9
10
10
## Installation
11
11
12
-
```javascript
13
-
npm install javascript-stringify --save
14
-
bower install javascript-stringify --save
15
-
```
16
-
17
-
### Node
18
-
19
-
```javascript
20
-
var javascriptStringify =require('javascript-stringify');
21
12
```
22
-
23
-
### AMD
24
-
25
-
```javascript
26
-
define(function (require, exports, module) {
27
-
var javascriptStringify =require('javascript-stringify');
28
-
});
29
-
```
30
-
31
-
### `<script>` tag
32
-
33
-
```html
34
-
<scriptsrc="javascript-stringify.js"></script>
13
+
npm install javascript-stringify --save
35
14
```
36
15
37
16
## Usage
38
17
39
18
```javascript
40
-
javascriptStringify(value[, replacer [, space [, options]]])
19
+
import { stringify } from"javascript-stringify";
41
20
```
42
21
43
-
The API is similar to `JSON.stringify`. However, any value returned by the replacer will be used literally. For this reason, the replacer is passed three arguments - `value`, `indentation` and `stringify`. If you need to continue the stringification process inside your replacer, you can call `stringify(value)` with the new value.
44
-
45
-
The `options` object allows some additional configuration:
22
+
The API is similar `JSON.stringify`:
46
23
47
-
***maxDepth**_(number, default: 100)_ The maximum depth of values to stringify
48
-
***maxValues**_(number, default: 100000)_ The maximum number of values to stringify
49
-
***references**_(boolean, default: false)_ Restore circular/repeated references in the object (uses IIFE)
50
-
***skipUndefinedProperties**_(boolean, default: false)_ Omits `undefined` properties instead of restoring as `undefined`
24
+
-`value` The value to convert to a string
25
+
-`replacer` A function that alters the behavior of the stringification process
26
+
-`space` A string or number that's used to insert white space into the output for readability purposes
27
+
-`options`
28
+
-**maxDepth**_(number, default: 100)_ The maximum depth of values to stringify
29
+
-**maxValues**_(number, default: 100000)_ The maximum number of values to stringify
30
+
-**references**_(boolean, default: false)_ Restore circular/repeated references in the object (uses IIFE)
31
+
-**skipUndefinedProperties**_(boolean, default: false)_ Omits `undefined` properties instead of restoring as `undefined`
0 commit comments