Copyright © 2007 Mochi Media, Inc.
Authors: Bob Ippolito (bob@mochimedia.com).
Yet another JSON (RFC 4627) library for Erlang. mochijson2 works with binaries as strings, arrays as lists (without an {array, _}) wrapper and it only knows how to decode UTF-8 (and ASCII).
JSON terms are decoded as follows (javascript -> erlang):| decode/1 | Decode the given iolist to Erlang terms. |
| decode/2 | Decode the given iolist to Erlang terms using the given object format for decoding, where proplist returns JSON objects as [{binary(), json_term()}] proplists, eep18 returns JSON objects as {[binary(), json_term()]}, and struct returns them as-is. |
| decoder/1 | Create a decoder/1 with the given options. |
| encode/1 | Encode the given as JSON to an iolist. |
| encoder/1 | Create an encoder/1 with the given options. |
decode(S) -> any()
Decode the given iolist to Erlang terms.
decode(S, Options) -> any()
Decode the given iolist to Erlang terms using the given object format for decoding, where proplist returns JSON objects as [{binary(), json_term()}] proplists, eep18 returns JSON objects as {[binary(), json_term()]}, and struct returns them as-is.
decoder(Options) -> any()
Create a decoder/1 with the given options.
encode(Any) -> any()
Encode the given as JSON to an iolist.
encoder(Options) -> any()
Create an encoder/1 with the given options. Emit unicode as utf8 (default - false)
Generated by EDoc