https://github.com/ravenox/go-jsoncommentstrip
Library for strip JSON comments
https://github.com/ravenox/go-jsoncommentstrip
comments golang json strip strip-json-comments
Last synced: 3 months ago
JSON representation
Library for strip JSON comments
- Host: GitHub
- URL: https://github.com/ravenox/go-jsoncommentstrip
- Owner: RaveNoX
- License: mit
- Created: 2016-09-30T18:25:10.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-03-30T16:34:04.000Z (over 6 years ago)
- Last Synced: 2025-04-13T22:08:01.575Z (3 months ago)
- Topics: comments, golang, json, strip, strip-json-comments
- Language: Go
- Size: 14.6 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# go-jsoncommentstrip
[](https://travis-ci.org/RaveNoX/go-jsoncommentstrip)
[](https://godoc.org/github.com/RaveNoX/go-jsoncommentstrip)GO library for strip JSON comments from input.
## Comment Types
### Single Line
```json
{
// this is a comment
"not_a_comment": "// this is not a comment"
}
```### Multiple Lines
```json
[
/* multi
line
"comment",
*/
"value": "this is not comment" /* this is another comment */
]
```## Escaping in JSON
```json
{
"test": "\"valid string // /*" // escaped string
}
```## Line Endings Support
Library normally working with *NIX `\n` and Windows `\r\n` line endings.## Commandline Tool
```bash
$ go get github.com/RaveNoX/go-jsoncommentstrip/cmd/jsoncommentstrip
$ cat json_with_comments.json | jsoncommentstrip
```## License
[MIT](./LICENSE.MD)