JSON helpers for npm manifest and lock files.
npm_ex writes generated JSON files such as package.json, npm.lock, and
shrinkwrap files. Those files should be stable across repeated writes, so maps
are recursively converted to Jason.OrderedObject values sorted by key before
encoding. Jason handles the actual JSON encoding, escaping, duplicate-key
checks, and pretty formatting.
Summary
Functions
Decode JSON into maps with string keys.
Decode JSON into maps with string keys, raising on invalid input.
Encode a term as pretty-printed JSON with recursively sorted object keys.
Read and decode a JSON file.
Functions
@spec decode(iodata()) :: {:ok, term()} | {:error, Jason.DecodeError.t()}
Decode JSON into maps with string keys.
Decode JSON into maps with string keys, raising on invalid input.
Encode a term as pretty-printed JSON with recursively sorted object keys.
Read and decode a JSON file.