json-parser alternatives and similar libraries
Based on the "JSON" category.
Alternatively, view json-parser alternatives based on common mentions on social networks and blogs.
-
simdjson
Parsing gigabytes of JSON per second : used by Facebook/Meta Velox, the Node.js runtime, ClickHouse, WatermelonDB, Apache Doris, Milvus, StarRocks -
JSMN
Jsmn is a world fastest JSON parser/tokenizer. This is the official repo replacing the old one at Bitbucket -
json-c
https://github.com/json-c/json-c is the official code repository for json-c. See the wiki for release tarballs for download. API docs at http://json-c.github.io/json-c/ -
frozen
JSON parser and generator for C/C++ with scanf/printf like interface. Targeting embedded systems. -
json_dto
A small header-only library for converting data between json representation and c++ structs
InfluxDB - Purpose built for real-time analytics at any scale.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of json-parser or a related project?
README
Very low footprint JSON parser written in portable ANSI C.
- BSD licensed with no dependencies (i.e. just drop the C file into your project)
- Never recurses or allocates more memory than it needs
- Very simple API with operator sugar for C++
Want to serialize? Check out json-builder!
Installing
There is now a makefile which will produce a libjsonparser static and dynamic library. However, this
is not required to build json-parser, and the source files (json.c
and json.h
) should be happy
in any build system you already have in place.
API
json_value * json_parse (const json_char * json,
size_t length);
json_value * json_parse_ex (json_settings * settings,
const json_char * json,
size_t length,
char * error);
void json_value_free (json_value *);
The type
field of json_value
is one of:
json_object
(seeu.object.length
,u.object.values[x].name
,u.object.values[x].value
)json_array
(seeu.array.length
,u.array.values
)json_integer
(seeu.integer
)json_double
(seeu.dbl
)json_string
(seeu.string.ptr
,u.string.length
)json_boolean
(seeu.boolean
)json_null
Compile-Time Options
-DJSON_TRACK_SOURCE
Stores the source location (line and column number) inside each json_value
.
This is useful for application-level error reporting.
Runtime Options
settings |= json_enable_comments;
Enables C-style // line
and /* block */
comments.
size_t value_extra
The amount of space (if any) to allocate at the end of each json_value
, in
order to give the application space to add metadata.
void * (* mem_alloc) (size_t, int zero, void * user_data);
void (* mem_free) (void *, void * user_data);
Custom allocator routines. If NULL, the default malloc
and free
will be used.
The user_data
pointer will be forwarded from json_settings
to allow application
context to be passed.
Changes in version 1.1.0
UTF-8 byte order marks are now skipped if present
Allows cross-compilation by honoring --host if given (@wkz)
Maximum size for error buffer is now exposed in header (@LB--)
GCC warning for
static
afterconst
fixed (@batrick)Optional support for C-style line and block comments added (@Jin-W-FS)
name_length
field added to object valuesIt is now possible to retrieve the source line/column number of a parsed
json_value
whenJSON_TRACK_SOURCE
is enabledThe application may now extend
json_value
using thevalue_extra
settingUn-ambiguate pow call in the case of C++ overloaded pow (@fcartegnie)
Fix null pointer de-reference when a non-existing array is closed and no root value is present
*Note that all licence references and agreements mentioned in the json-parser README section above
are relevant to that project's source code only.