UNPKG

972 BMarkdownView Raw
1jsonify
2=======
3
4This module provides Douglas Crockford's JSON implementation without modifying
5any globals.
6
7`stringify` and `parse` are merely exported without respect to whether or not a
8global `JSON` object exists.
9
10methods
11=======
12
13var json = require('jsonify');
14
15json.parse(source, reviver)
16---------------------------
17
18Return a new javascript object from a parse of the `source` string.
19
20If a `reviver` function is specified, walk the structure passing each name/value
21pair to `reviver.call(parent, key, value)` to transform the `value` before
22parsing it.
23
24json.stringify(value, replacer, space)
25--------------------------------------
26
27Return a string representation for `value`.
28
29If `replacer` is specified, walk the structure passing each name/value pair to
30`replacer.call(parent, key, value)` to transform the `value` before stringifying
31it.
32
33If `space` is a number, indent the result by that many spaces.
34If `space` is a string, use `space` as the indentation.