| decode/1 | Decodes a binary JSON into a term. |
| decode/2 | Decodes a binary JSON into a term. |
| decode_iodata/1 | Decodes an iodata JSON into a term. |
| decode_iodata/2 | Decodes an iodata JSON into a term. |
| decode_stream_continue/2 | Continue parsing a stream of bytes of a JSON value. |
| decode_stream_end/1 | Ends parsing a stream of bytes of a JSON value. |
| decode_stream_start/1 | Equivalent to decode_stream_start(JSON, #{}).
|
| decode_stream_start/2 | Begin parsing a stream of bytes of a JSON value. |
| encode/1 | Encodes a term into a binary JSON. |
| encode/2 | Encodes a term into a binary JSON. |
| encode_to_iodata/1 | Encodes a term into an iodata JSON. |
| encode_to_iodata/2 | Encodes a term into an iodata JSON. |
| format/2 | Formats a binary JSON. |
| format_to_iodata/2 | Formats a binary JSON. |
| minify/1 | Minifies a binary JSON. |
| minify_to_iodata/1 | Minifies a binary JSON. |
decode(JSON) -> term()
JSON = binary()
Decodes a binary JSON into a term.
Example:
1> euneus:decode(<<"\"foo\"">>). <<"foo">>
Decodes a binary JSON into a term.
Example:
1> euneus:decode(<<"\"foo\"">>, #{}).
<<"foo">>
decode_iodata(JSON) -> term()
JSON = iodata()
Decodes an iodata JSON into a term.
Example:
1> euneus:decode_iodata([$", <<"foo">>, $"]). <<"foo">>
Decodes an iodata JSON into a term.
Example:
1> euneus:decode_iodata([$", <<"foo">>, $"], #{}).
<<"foo">>
decode_stream_continue(JSON, State) -> Result
JSON = binary() | end_of_inputState = euneus_decoder:stream_state()Result = euneus_decoder:stream_result()
Equivalent to euneus_decoder:stream_continue(JSON, State).
Continue parsing a stream of bytes of a JSON value.
Example:
1> begin
.. {continue, State} = euneus:decode_stream_start(<<"{\"foo\":">>),
.. euneus:decode_stream_continue(<<"1}">>, State)
.. end.
{end_of_input,#{<<"foo">> => 1}}
decode_stream_end(State) -> Result
State = euneus_decoder:stream_state()Result = {end_of_input, term()}
Equivalent to euneus_decoder:stream_continue(end_of_input, State).
Ends parsing a stream of bytes of a JSON value.
Example:
1> begin
.. {continue, State} = euneus:decode_stream_start(<<"123">>),
.. euneus:decode_stream_end(State)
.. end.
{end_of_input,123}
Equivalent to decode_stream_start(JSON, #{}).
decode_stream_start(JSON, Options) -> Result
JSON = binary()Options = euneus_decoder:options()Result = euneus_decoder:stream_result()
Equivalent to euneus_decoder:stream_start(JSON, Options).
Begin parsing a stream of bytes of a JSON value.
encode(Term) -> binary()
Term = term()
Encodes a term into a binary JSON.
Example:
1> euneus:encode(foo). <<"\"foo\"">>
Encodes a term into a binary JSON.
Example:
1> euneus:encode(foo, #{}).
<<"\"foo\"">>
encode_to_iodata(Term) -> iodata()
Term = term()
Encodes a term into an iodata JSON.
Example:
1> euneus:encode_to_iodata(foo). [$", <<"foo">>, $"]
Encodes a term into an iodata JSON.
Example:
1> euneus:encode_to_iodata(foo, #{}).
[$", <<"foo">>, $"]
Equivalent to iolist_to_binary(format(JSON, Options)).
Formats a binary JSON.
Example:
1> Opts = #{
.. indent_type => tabs,
.. indent_width => 1,
.. spaced_values => true,
.. crlf => n
.. }.
#{indent_type => tabs,indent_width => 1,spaced_values => true, crlf => n}
2> euneus:format(<<" \n{\"foo\" : [ true , \n null ] \n } ">>, Opts).
<<"{\n\t\"foo\": [\n\t\ttrue,\n\t\tnull\n\t]\n}">>
Formats a binary JSON.
minify(JSON) -> binary()
JSON = binary()
Equivalent to iolist_to_binary(minify_to_iodata(JSON)).
Minifies a binary JSON.
Example:
1> euneus:minify(<<" \n{\"foo\" : [ true , \n null ] \n } ">>).
<<"{\"foo\":[true,null]}">>
minify_to_iodata(JSON) -> iodata()
JSON = binary()
Minifies a binary JSON.
Generated by EDoc