Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON encoding #2

Open
boudra opened this issue Jul 28, 2018 · 2 comments
Open

JSON encoding #2

boudra opened this issue Jul 28, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@boudra
Copy link
Owner

boudra commented Jul 28, 2018

  • Take an Erlang term and convert it into JSON events
  • Take a list of events and encode into a JSON string representation
@boudra boudra added the enhancement New feature or request label Jul 28, 2018
@TreyE
Copy link

TreyE commented Dec 26, 2018

Hi, I'm the writer of https://github.com/TreyE/json_stream_encoder. I was wondering if you might be looking for something like this. It's a simple encoder whose main winning point is not needing the entire Erlang/Elixir term to be in memory. The license is MIT as well, so if you find it useful you might want to just steal it or some of its very simple ideas (with my blessing).

I've been mainly using it to stream encoding of huge sets of SQL records to an IOish item - it may not suit your use case but hopefully it provides some helpful starting places that might save you some time.

@boudra
Copy link
Owner Author

boudra commented Jan 2, 2019

Hi @TreyE, thanks, should be helpful!

This is how I was thinking encoding would work:

iex> Jaxon.Encoder.term_to_events(%{"key" => true})
[:start_object, {:string, "key"}, :colon, {:boolean, true}, :end_object]

iex> Jaxon.Encoder.encode([:start_object, {:string, "key"}, :colon, {:boolean, true}, :end_object])
"{\"key\":true}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants