aboutsummaryrefslogtreecommitdiff
path: root/atom/packages/pretty-json/node_modules/jsonminify/TestDoc.html
blob: f470bdf7941f564e80befd0cee68867225428d7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
    <section class="suite">
      <h1>JSON.minify</h1>
      <dl>
        <dt>define</dt>
        <dd><pre><code>JSON.minify.should.be.ok;</code></pre></dd>
        <dt>in-memory string</dt>
        <dd><pre><code>var json = '{&quot;key&quot;:&quot;value&quot;}';
var res = JSON.minify(json);
JSON.parse(res).key.should.equal('value');</code></pre></dd>
        <dt>comment.json</dt>
        <dd><pre><code>var json = fs.readFileSync(__dirname + '/comment.json', 'utf8');
var res = JSON.parse(JSON.minify(json));
res.foo.should.equal('bar');</code></pre></dd>
        <dt>comment.json</dt>
        <dd><pre><code>var json = fs.readFileSync(__dirname + '/plain.json', 'utf8');
var res = JSON.parse(JSON.minify(json));
res.foo.should.equal('bar');</code></pre></dd>
      </dl>
    </section>