{"id":18131484,"url":"https://github.com/crownedgrouse/jason","last_synced_at":"2025-04-15T22:54:14.245Z","repository":{"id":57509015,"uuid":"76792936","full_name":"crownedgrouse/jason","owner":"crownedgrouse","description":"JSON encode/decode library written in Erlang","archived":false,"fork":false,"pushed_at":"2025-04-12T15:19:02.000Z","size":181,"stargazers_count":16,"open_issues_count":4,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-15T22:54:07.774Z","etag":null,"topics":["decoding","decoding-library","encode","encoding-library","erlang","json"],"latest_commit_sha":null,"homepage":"","language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crownedgrouse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"custom":["https://www.blockchain.com/btc/address/1Ep9VoyNtnNiGoXM52V6NwcMh4SZ9bxkAG","https://etherscan.io/address/0xfac5e46ffe12ec1fc2830d95c22e6583d163d7f9"]}},"created_at":"2016-12-18T16:11:45.000Z","updated_at":"2025-04-12T15:19:06.000Z","dependencies_parsed_at":"2025-01-19T22:24:42.437Z","dependency_job_id":"244a0bec-3c69-4f04-bbee-1aa0ce0a1d6a","html_url":"https://github.com/crownedgrouse/jason","commit_stats":{"total_commits":93,"total_committers":1,"mean_commits":93.0,"dds":0.0,"last_synced_commit":"7da1fb508b906411f8e4158058241e6d15535ef0"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crownedgrouse%2Fjason","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crownedgrouse%2Fjason/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crownedgrouse%2Fjason/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crownedgrouse%2Fjason/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crownedgrouse","download_url":"https://codeload.github.com/crownedgrouse/jason/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249167439,"owners_count":21223505,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["decoding","decoding-library","encode","encoding-library","erlang","json"],"created_at":"2024-11-01T12:07:38.839Z","updated_at":"2025-04-15T22:54:14.232Z","avatar_url":"https://github.com/crownedgrouse.png","language":"Erlang","funding_links":["https://www.blockchain.com/btc/address/1Ep9VoyNtnNiGoXM52V6NwcMh4SZ9bxkAG","https://etherscan.io/address/0xfac5e46ffe12ec1fc2830d95c22e6583d163d7f9"],"categories":[],"sub_categories":[],"readme":"# jason ![Build status](https://github.com/crownedgrouse/jason/actions/workflows/erlang.yml/badge.svg)  #\n\n`jason` is a JSON encode/decode library written in Erlang.\n\n**DEPRECATION NOTE: as a JSON library is now part of ERLANG/OTP, this library will be replaced by another in close future.**\n\n*`json` library will be used instead for parsing, encoding and decoding, but features will be kept. A new name will be chosen in order to be less confusing with the Elixir eponym library.*\n\n## Overview ##\n\nThis project was mainly created for easy handling of JSON from/to Erlang records,\nbut allow binary struct, proplists and maps formats.\n\nProject is available on hex.pm under name [jason_erl](https://hex.pm/packages/jason_erl).\n\n`jason` offer also a rare feature : pretty printing JSON in several indentation styles. \n\nSee [Wiki](https://github.com/crownedgrouse/jason/wiki) for documentation and tutorial.\n\n## Specifications ##\n* Pure Erlang (no NIF)\n* Decoding use Leex/Yecc parser\n* JSON object can be decoded in several formats :\n   * binary struct\n   * proplists\n   * maps\n   * records with automatic ad hoc module loaded for record handling\n* No `parse_transform` . Record definitions can be given as arguments or extracted from module(s) abstract code at runtime.\n\n## Data types ##\njason:types/0 show in console how Erlang types are converted to JSON and back to Erlang data.\n\n\n```\n1\u003e jason:types().\nErlang                       JSON                      Erlang\n================================================================================\n\n%% Atoms\nnull                    -\u003e null                 -\u003e null\nundefined               -\u003e null                 -\u003e null\ntrue                    -\u003e true                 -\u003e true\nfalse                   -\u003e false                -\u003e false\nany                     -\u003e \"any\"                -\u003e \u003c\u003c\"any\"\u003e\u003e\n\n%% Integer\n123                     -\u003e 123                  -\u003e 123\n\n%% Float (Automatic precision)\n123.456789              -\u003e 123.456789           -\u003e 123.456789\n2.30e+0                 -\u003e 2.3                  -\u003e 2.3\n2.30e+3                 -\u003e 2300.0               -\u003e 2.3e3\n2.30e-3                 -\u003e 0.0023               -\u003e 0.0023\n\n%% List\n[1,2,3]                 -\u003e [1,2,3]              -\u003e [1,2,3]\n[a,\"b\",\u003c\u003c\"c\"\u003e\u003e]         -\u003e [\"a\",\"b\",\"c\"]        -\u003e [\u003c\u003c\"a\"\u003e\u003e,\u003c\u003c\"b\"\u003e\u003e,\u003c\u003c\"c\"\u003e\u003e]\n\n%% Date\n{{1970,1,1},{0,0,0}}    -\u003e \"1970-01-01T00:00:00Z\"       -\u003e {{1970,1,1},\n                                                            {0,0,0}}\n{{1970,1,1},{0,0,0.0}}  -\u003e \"1970-01-01T00:00:00.000Z\"   -\u003e {{1970,1,1},\n                                                            {0,0,0.0}}\n\n%% Binary (key/value) mode=struct (default)\n\u003c\u003c\"abc\"\u003e\u003e               -\u003e \"abc\"                -\u003e \u003c\u003c\"abc\"\u003e\u003e\n\n%% Struct\n%  mode=struct (default)\n{\u003c\u003c\"abc\"\u003e\u003e,\u003c\u003c\"def\"\u003e\u003e}   -\u003e {\"abc\": \"def\"}       -\u003e [{\u003c\u003c\"abc\"\u003e\u003e,\u003c\u003c\"def\"\u003e\u003e}]\n%  mode=proplist\n{\u003c\u003c\"abc\"\u003e\u003e,\u003c\u003c\"def\"\u003e\u003e}   -\u003e {\"abc\": \"def\"}       -\u003e [{abc,\"def\"}]\n%  mode=map\n{\u003c\u003c\"abc\"\u003e\u003e,\u003c\u003c\"def\"\u003e\u003e}   -\u003e {\"abc\": \"def\"}       -\u003e #{abc =\u003e \"def\"}\n%  mode=record\n{\u003c\u003c\"abc\"\u003e\u003e,\u003c\u003c\"def\"\u003e\u003e}   -\u003e {\"abc\": \"def\"}       -\u003e {'111259705',\"def\"}\n                                                with -record('111259705', {abc  = []  :: list()}).\n\n%% Proplist\n%  mode=struct (default)\n[{abc,\u003c\u003c\"def\"\u003e\u003e}]       -\u003e {\"abc\": \"def\"}       -\u003e [{\u003c\u003c\"abc\"\u003e\u003e,\u003c\u003c\"def\"\u003e\u003e}]\n%  mode=proplist\n[{abc,\u003c\u003c\"def\"\u003e\u003e}]       -\u003e {\"abc\": \"def\"}       -\u003e [{abc,\"def\"}]\n%  mode=map\n[{abc,\u003c\u003c\"def\"\u003e\u003e}]       -\u003e {\"abc\": \"def\"}       -\u003e #{abc =\u003e \"def\"}\n%  mode=record\n[{abc,\u003c\u003c\"def\"\u003e\u003e}]       -\u003e {\"abc\": \"def\"}       -\u003e {'111259705',\"def\"}\n                                                with -record('111259705', {abc  = []  :: list()}).\n\n%% Map\n%  mode=struct (default)\n#{\"abc\" =\u003e \u003c\u003c\"def\"\u003e\u003e}   -\u003e {\"abc\": \"def\"}       -\u003e [{\u003c\u003c\"abc\"\u003e\u003e,\u003c\u003c\"def\"\u003e\u003e}]\n%  mode=proplist\n#{\"abc\" =\u003e \u003c\u003c\"def\"\u003e\u003e}   -\u003e {\"abc\": \"def\"}       -\u003e [{abc,\"def\"}]\n%  mode=map\n#{\"abc\" =\u003e \u003c\u003c\"def\"\u003e\u003e}   -\u003e {\"abc\": \"def\"}       -\u003e #{abc =\u003e \"def\"}\n%  mode=record\n#{\"abc\" =\u003e \u003c\u003c\"def\"\u003e\u003e}   -\u003e {\"abc\": \"def\"}       -\u003e {'111259705',\"def\"}\n                                                with -record('111259705', {abc  = []  :: list()}).\n\n%% Record - encoding using option [{records, [{r, record_info(fields, r)}]}] or [{records, [{r, [k1,k2]}]}]\n%  mode=struct (default)\n{r,1,\u003c\u003c\"ab\"\u003e\u003e}          -\u003e {\"k1\": 1,\"k2\": \"ab\"} -\u003e [{\u003c\u003c\"k1\"\u003e\u003e,1},\n                                                    {\u003c\u003c\"k2\"\u003e\u003e,\u003c\u003c\"ab\"\u003e\u003e}]\n%  mode=proplist\n{r,1,\u003c\u003c\"ab\"\u003e\u003e}          -\u003e {\"k1\": 1,\"k2\": \"ab\"} -\u003e [{k1,1},{k2,\"ab\"}]\n%  mode=map\n{r,1,\u003c\u003c\"ab\"\u003e\u003e}          -\u003e {\"k1\": 1,\"k2\": \"ab\"} -\u003e #{k1 =\u003e 1,k2 =\u003e \"ab\"}\n%  mode=record\n{r,1,\u003c\u003c\"ab\"\u003e\u003e}          -\u003e {\"k1\": 1,\"k2\": \"ab\"} -\u003e {'8056669',1,\"ab\"}\n                                                with -record('8056669', {k1  = 0  :: integer(), k2  = []  :: list()}).\n\n%  mode=record - decoding using option [{records, [{r, [k1,k2]}]}]\n                                                -\u003e {r,1,\"ab\"}\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrownedgrouse%2Fjason","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrownedgrouse%2Fjason","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrownedgrouse%2Fjason/lists"}