Skip to content

hhff/oj

 
 

Repository files navigation

{}j gem

Build Status AppVeyor Gem Gem

A fast JSON parser and Object marshaller as a Ruby gem.

Version 3.0 is out! 3.0 provides better json gem and Rails compatibility. It also provides additional optimization options.

Using

require 'oj'

h = { 'one' => 1, 'array' => [ true, false ] }
json = Oj.dump(h)

# json =
# {
#   "one":1,
#   "array":[
#     true,
#     false
#   ]
# }

h2 = Oj.load(json)
puts "Same? #{h == h2}"
# true

Installation

gem install oj

or in Bundler:

gem 'oj'

Further Reading

For more details on options, modes, advanced features, and more follow these links.

Releases

See {file:CHANGELOG.md}

Links

Follow @peterohler on Twitter for announcements and news about the Oj gem.

Performance Comparisons

Links of Interest

Packages

No packages published

Languages

  • C 60.0%
  • Ruby 38.7%
  • Other 1.3%