JSON.minify
JSON.minify copied to clipboard
Simple minifier for JSON to remove comments and whitespace (node.js and browser)
Results
3
JSON.minify issues
Sort by
recently updated
recently updated
newest added
If you pass an empty object without carry line inside, the function returns an empty string, which fails JSON.parse. To reproduce it you may run: ``` JSON.parse(jsonminify('{}')) ``` the expected...
```js it('comments last line', function() { var json = `{"key":"value"}//comments`; var res = JSON.minify(json); res.should.equal(`{"key":"value"}`); }); // but get `{"key":"value"}comments` ```
```js it('remove whitespace', function() { var json = '{ " k e y ": " va lue" } '; var res = JSON.minify(json); res.should.equal('{" k e y ":" va lue"}');...