Skip to content

A json decoder/encoder solely created to test the parser combinator library nimble_parsec :)

Notifications You must be signed in to change notification settings

WilliamGanrot/nimble_json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NimbleJson

A json decoder/encoder solely created to test the parser combinator library nimble_parsec :)

Decode

json_string = "{\"a\":\"wow\",\"c\":{\"l\":[\"a\",23.2],\"x\":23}}"

{:ok, %{"a" => "wow", "c" => %{"l" => ["a", 23.2], "x" => 23}}} =
      NimbleJson.decode(json_string)

Encode

m = %{
      a: "wow",
      c: %{l: ["a", 23.2], x: 23}
    }
    
{:ok, "{\"a\":\"wow\",\"c\":{\"l\":[\"a\",23.2],\"x\":23}}"} = NimbleJson.encode(m)

Installation

If available in Hex, the package can be installed by adding nimble_json to your list of dependencies in mix.exs:

def deps do
  [
    {:nimble_json, "~> 0.1.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/nimble_json.

About

A json decoder/encoder solely created to test the parser combinator library nimble_parsec :)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages