muhammadmuzzammil1998 / Jsonc

Licence: mit
JSON with comments for Go!

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Labels

Projects that are alternatives of or similar to Jsonc

Mjson
C/C++ JSON parser, emitter, JSON-RPC engine for embedded systems
Stars: ✭ 136 (-4.23%)
Mutual labels:  json
Node Convict
Featureful configuration management library for Node.js
Stars: ✭ 1,855 (+1206.34%)
Mutual labels:  json
Json Autotype
Automatic Haskell type inference from JSON input
Stars: ✭ 139 (-2.11%)
Mutual labels:  json
Reconfigure
Config-file-to-Python mapping library (ORM).
Stars: ✭ 136 (-4.23%)
Mutual labels:  json
Kafka Connect Mongodb
**Unofficial / Community** Kafka Connect MongoDB Sink Connector - Find the official MongoDB Kafka Connector here: https://www.mongodb.com/kafka-connector
Stars: ✭ 137 (-3.52%)
Mutual labels:  json
Cfgdiff
diff(1) all your configs
Stars: ✭ 138 (-2.82%)
Mutual labels:  json
Aping
angular module to get and display data by adding html-attributes
Stars: ✭ 135 (-4.93%)
Mutual labels:  json
Fig
A minimalist Go configuration library
Stars: ✭ 142 (+0%)
Mutual labels:  json
Libvirt Hook Qemu
Libvirt hook for setting up iptables port-forwarding rules when using NAT-ed networking.
Stars: ✭ 137 (-3.52%)
Mutual labels:  json
Yii2 Json Api
Implementation of JSON API specification for the Yii framework
Stars: ✭ 139 (-2.11%)
Mutual labels:  json
Rq
Record Query - A tool for doing record analysis and transformation
Stars: ✭ 1,808 (+1173.24%)
Mutual labels:  json
Fblog
Small command-line JSON Log viewer
Stars: ✭ 137 (-3.52%)
Mutual labels:  json
Packages
📦 Package configurations - The #1 free and open source CDN built to make life easier for developers.
Stars: ✭ 139 (-2.11%)
Mutual labels:  json
Framework
Strongly-typed JavaScript object with support for validation and error handling.
Stars: ✭ 136 (-4.23%)
Mutual labels:  json
Criterion
Microbenchmarking for Modern C++
Stars: ✭ 140 (-1.41%)
Mutual labels:  json
Elasticsearch Dataformat
Excel/CSV/BulkJSON downloads on Elasticsearch.
Stars: ✭ 135 (-4.93%)
Mutual labels:  json
Dijon
A Dynamically Typed Scala Json Library
Stars: ✭ 139 (-2.11%)
Mutual labels:  json
Dirty Json
A parser for invalid JSON
Stars: ✭ 141 (-0.7%)
Mutual labels:  json
Autocser
AutoCSer is a high-performance RPC framework. AutoCSer 是一个以高效率为目标向导的整体开发框架。主要包括 TCP 接口服务框架、TCP 函数服务框架、远程表达式链组件、前后端一体 WEB 视图框架、ORM 内存索引缓存框架、日志流内存数据库缓存组件、消息队列组件、二进制 / JSON / XML 数据序列化 等一系列无缝集成的高性能组件。
Stars: ✭ 140 (-1.41%)
Mutual labels:  json
Noproto
Flexible, Fast & Compact Serialization with RPC
Stars: ✭ 138 (-2.82%)
Mutual labels:  json

jsonc

JSON with comments for Go!
travisci

JSONC is a superset of JSON which supports comments. JSON formatted files are readable to humans but the lack of comments decreases readability. With JSONC, you can use block (/* */) and single line (//) comments to describe the functionality. Microsoft VS Code also uses this format in their configuration files like settings.json, keybindings.json, launch.json, etc.

jsonc

What this package offers

JSONC for Go offers ability to convert and unmarshal JSONC to pure JSON. It also provides functionality to read JSONC file from disk and return JSONC and corresponding JSON encoding to operate on. However, it only provides a one way conversion. That is, you can not generate JSONC from JSON. Read documentation for detailed examples.

Usage

go get it

Run go get command to install the package.

$ go get muzzammil.xyz/jsonc

Import jsonc

Import muzzammil.xyz/jsonc to your source file.

package main

import (
  "fmt"

  "muzzammil.xyz/jsonc"
)

Test it

Now test it!

func main() {
  j := []byte(`{"foo": /*comment*/ "bar"}`)
  jc := jsonc.ToJSON(j) // Calling jsonc.ToJSON() to convert JSONC to JSON
  if jsonc.Valid(jc) {
    fmt.Println(string(jc))
  } else {
    fmt.Println("Invalid JSONC")
  }
}
$ go run app.go
{"foo":"bar"}

Contributions

Contributions are welcome but kindly follow the Code of Conduct and guidelines. Please don't make Pull Requests for typographical errors, grammatical mistakes, "sane way" of doing it, etc. Open an issue for it. Thanks!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].