Fast streaming JSON parsing and encoding for Ruby, built on the YAJL C library
open sourceMITfree
yajl-ruby is an open source Ruby gem that binds the YAJL C library for parsing and generating JSON. It reads and writes JSON directly from and to IO streams or strings, including Bzip2, Gzip and Deflate compressed streams, handles several JSON documents in a row, can stand in for the json gem through a compatibility API, and includes a basic HTTP client that parses JSON as the response arrives.
Problems it solves
- parse a large JSON stream in Ruby without loading it all into memory
- speed up JSON parsing and generation in a Ruby app
- read many JSON objects one after another from a socket in Ruby
Features
- parse and encode JSON directly from and to IO streams or strings
- compressed stream parsing and encoding for Bzip2, Gzip and Deflate
- parse and encode several JSON documents from one stream
- drop-in compatibility API for the json gem
- basic HTTP client that parses JSON as the response body arrives
- HTML-safe encoding option
Limitations
- Its HTTP client supports only GET requests1
Alternatives
The same job
These do what yajl-ruby does.
- Oj A fast JSON parser and Object marshaller as a Ruby gem
