comment-json
Advanced tools
Comparing version 3.0.0 to 3.0.1
{ | ||
"name": "comment-json", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Parse and stringify JSON with comments. It will retain comments even after saved!", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -126,3 +126,3 @@ [![Build Status](https://travis-ci.org/kaelzhang/node-comment-json.svg?branch=master)](https://travis-ci.org/kaelzhang/node-comment-json) | ||
And the result will be: | ||
And the value of `parsed` will be: | ||
@@ -458,4 +458,28 @@ ```js | ||
## Special Cases about Trailing Comma | ||
If we have a JSON string `str` | ||
```js | ||
{ | ||
"foo": "bar", // comment | ||
} | ||
``` | ||
```js | ||
// When stringify, trailing commas will be eliminated | ||
const stringified = stringify(parse(str), null, 2) | ||
console.log(stringified) | ||
``` | ||
And it will print: | ||
```js | ||
{ | ||
"foo": "bar" // comment | ||
} | ||
``` | ||
## License | ||
[MIT](LICENSE) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40203
484