File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,19 @@ Stringify an object so it can be safely inlined in JavaScript code
10
10
11
11
npm install js-stringify
12
12
13
+ ## Usage
14
+
15
+ ``` js
16
+
17
+ var assert = require (' assert' );
18
+ var stringify = require (' js-stringify' );
19
+
20
+ assert (stringify (' foo' ) === ' "foo"' );
21
+ assert (stringify (' foo\u2028 bar\u2029 baz' ) === ' "foo\\ u2028bar\\ u2029baz"' );
22
+ assert (stringify (new Date (' 2014-12-19T03:42:00.000Z' )) === ' new Date("2014-12-19T03:42:00.000Z")' );
23
+ assert (stringify ({foo: ' bar' }) === ' {"foo":"bar"}' );
24
+ ```
25
+
13
26
## License
14
27
15
28
MIT
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " js-stringify" ,
3
- "version" : " 0 .0.0" ,
3
+ "version" : " 1 .0.0" ,
4
4
"description" : " Stringify an object so it can be safely inlined in JavaScript code" ,
5
5
"keywords" : [],
6
6
"dependencies" : {},
You can’t perform that action at this time.
0 commit comments