{"id":19691529,"url":"https://github.com/kbrw/json_stream","last_synced_at":"2025-12-11T23:41:15.167Z","repository":{"id":57510359,"uuid":"60390243","full_name":"kbrw/json_stream","owner":"kbrw","description":"Small but useful wrapper above erlang `jsx` to stream json elements from an Elixir binary stream.","archived":false,"fork":false,"pushed_at":"2024-03-25T13:18:31.000Z","size":21,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-27T15:55:31.628Z","etag":null,"topics":["erlang","json","parser"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kbrw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2016-06-04T02:58:31.000Z","updated_at":"2024-03-24T19:02:32.000Z","dependencies_parsed_at":"2024-11-11T19:09:43.336Z","dependency_job_id":"5a451707-adde-48e5-829e-c39fabf2fed9","html_url":"https://github.com/kbrw/json_stream","commit_stats":null,"previous_names":["awetzel/json_stream"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kbrw/json_stream","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbrw%2Fjson_stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbrw%2Fjson_stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbrw%2Fjson_stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbrw%2Fjson_stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kbrw","download_url":"https://codeload.github.com/kbrw/json_stream/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbrw%2Fjson_stream/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27672258,"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","status":"online","status_checked_at":"2025-12-11T02:00:11.302Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["erlang","json","parser"],"created_at":"2024-11-11T19:09:39.231Z","updated_at":"2025-12-11T23:41:15.154Z","avatar_url":"https://github.com/kbrw.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSONStream [![Build Status](https://github.com/kbrw/json_stream/actions/workflows/.github/workflows/build-and-test.yml/badge.svg)](https://github.com/kbrw/json_stream/actions/workflows/build-and-test.yml) [![Hex.pm](https://img.shields.io/hexpm/v/json_stream.svg)](https://hex.pm/packages/json_stream) [![Documentation](https://img.shields.io/badge/documentation-gray)](https://hexdocs.pm/json_stream) ![Hex.pm License](https://img.shields.io/hexpm/l/json_stream)\n\nSmall but useful wrapper above the erlang's JSON parsing toolkit [jsx](https://hex.pm/packages/jsx)\nto stream json elements from an Elixir binary stream.\n\n## Usage\n\n```elixir\nstream_path = [\"data\", 1, \"actions\"]\n{actions_stream, doc_fun} =\n  \"example.json\"\n  |\u003e File.stream!([],2048)\n  |\u003e JSONStream.stream(stream_path)\n\nEnum.to_list(actions_stream )\n# Will output:\n# [\n#   %{\"link\" =\u003e \"http://www.facebook.com/X998/posts/Y998\", \"name\" =\u003e \"Like\"},\n#   %{\"link\" =\u003e \"http://www.facebook.com/X998/posts/Y998\", \"name\" =\u003e \"Comment\"}\n# ]\n\ndoc_fun.()\n# Will output:\n# %{\n#   \"data\" =\u003e [\n#     %{\n#       \"actions\" =\u003e [\n#         %{\n#           \"link\" =\u003e \"http://www.facebook.com/X999/posts/Y999\",\n#           \"name\" =\u003e \"Comment\"\n#         },\n#         %{\"link\" =\u003e \"http://www.facebook.com/X999/posts/Y999\", \"name\" =\u003e \"Like\"}\n#       ],\n#       \"created_time\" =\u003e \"2010-08-02T21:27:44+0000\",\n#       \"from\" =\u003e %{\"id\" =\u003e \"X12\", \"name\" =\u003e \"Tom Brady\"},\n#       \"id\" =\u003e \"X999_Y999\",\n#       \"message\" =\u003e \"Looking forward to 2010!\",\n#       \"type\" =\u003e \"status\",\n#       \"updated_time\" =\u003e \"2010-08-02T21:27:44+0000\"\n#     },\n#     %{\n#       \"actions\" =\u003e [],\n#       \"created_time\" =\u003e \"2010-08-02T21:27:44+0000\",\n#       \"from\" =\u003e %{\"id\" =\u003e \"X18\", \"name\" =\u003e \"Peyton Manning\"},\n#       \"id\" =\u003e \"X998_Y998\",\n#       \"message\" =\u003e \"Where's my contract?\",\n#       \"type\" =\u003e \"status\",\n#       \"updated_time\" =\u003e \"2010-08-02T21:27:44+0000\"\n#     }\n#   ]\n# }\n```\n\n`stream_path` describe the JSON path (string for map key and integer\nfor array index), to the Array/Object you want to stream Element/{key,value}.\n\n`actions_stream` is the stream of element in case `stream_path`\ntargets an array, or a stream of `{k,v}` in case `stream_path`\ntargets a map.\n\n`doc_fun` is a function `()-\u003edoc` where `doc` will be the whole\nparsed json document, but without the elements from the stream. It\nwill be accessible only after the whole stream will be runned.\nElse, `doc_fun.()-\u003e :stream_not_finished`.\n\n## Installation\n\nThe package can be installed as:\n\n1. Add json_stream to your list of dependencies in `mix.exs`:\n  ```elixir\n  def deps do\n    [{:json_stream, \"~\u003e 0.0.2\"}]\n  end\n  ```\n\n2. Ensure json_stream is started before your application:\n  ```elixir\n  def application do\n    [applications: [:json_stream]]\n  end\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkbrw%2Fjson_stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkbrw%2Fjson_stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkbrw%2Fjson_stream/lists"}