Module jason

JSON encode/decode Erlang library.

Copyright © 2017 crownedgrouse.com

Authors: Eric Pailleau (jason@crownedgrouse.com).

Description

JSON encode/decode Erlang library

Function Index

decode/1Decode JSON data.
decode/2Decode JSON data with options.
decode_file/1Decode JSON file.
decode_file/2Decode JSON file with options.
decode_stream/1Decode stream Argument is an io_device() (either pid() or fd() from raw mode) First call create a finite statemachine and return {ok, ref()} or {error, Reason}.
decode_stream/2
dump/1Dump argonaut module of aliases to.
dump/2
encode/1Encode Erlang data to JSON.
encode/2Encode Erlang data to JSON with options.
encode_file/2Encode Erlang data to JSON file.
encode_file/3Encode Erlang data to JSON file with options.
pp/1Pretty print JSON data.
pp/2Pretty print JSON data.
types/0Display types transformation.

Function Details

decode/1

decode(Json::any()) -> any()

Decode JSON data

decode/2

decode(Json::any(), Opt::list()) -> any()

Decode JSON data with options

decode_file/1

decode_file(F::list()) -> any()

Decode JSON file

decode_file/2

decode_file(F::list(), Opt::list()) -> any()

Decode JSON file with options

decode_stream/1

decode_stream(R) -> any()

Decode stream Argument is an io_device() (either pid() or fd() from raw mode) First call create a finite statemachine and return {ok, ref()} or {error, Reason}. Where ref() is the finite state machine global name . All subsequent calls to decode_stream(ref()) will return 'sofar', 'end' or {'sofar', Term} Call to decode_stream(ref(), integer()) allow to specify how many bytes to read (sticky until another change). Default to 1024 bytes at start. 'sofar' means that no JSON term could be decoded for the moment, another call(s) are needed.

decode_stream/2

decode_stream(R, B) -> any()

dump/1

dump(Dir::list()) -> ok | {error, atom(), list()}

Dump argonaut module of aliases to

dump/2

dump(Dir, Module) -> any()

encode/1

encode(Term::any()) -> list()

Encode Erlang data to JSON

encode/2

encode(Term::any(), O::list()) -> list()

Encode Erlang data to JSON with options

encode_file/2

encode_file(Term::term(), Target::list()) -> ok | {error, atom()}

Encode Erlang data to JSON file

encode_file/3

encode_file(Term::any, Target::list(), Opt::list()) -> atom()

Encode Erlang data to JSON file with options

pp/1

pp(C::list()) -> list()

Pretty print JSON data

pp/2

pp(C::term(), Style::maybe_improper_list() | {pp, term(), term(), term(), term(), term()}) -> [any()]

Pretty print JSON data

types/0

types() -> ok

Display types transformation


Generated by EDoc