{"id":22998262,"url":"https://github.com/uswitch/ej","last_synced_at":"2025-08-14T00:31:55.345Z","repository":{"id":24056197,"uuid":"27442093","full_name":"uswitch/ej","owner":"uswitch","description":"a tool to convert from EDN to JSON","archived":false,"fork":false,"pushed_at":"2017-05-08T14:39:35.000Z","size":6,"stargazers_count":16,"open_issues_count":0,"forks_count":2,"subscribers_count":53,"default_branch":"master","last_synced_at":"2024-04-14T11:59:46.985Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uswitch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-02T16:40:49.000Z","updated_at":"2022-05-26T04:51:59.000Z","dependencies_parsed_at":"2022-07-23T23:46:22.703Z","dependency_job_id":null,"html_url":"https://github.com/uswitch/ej","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uswitch%2Fej","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uswitch%2Fej/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uswitch%2Fej/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uswitch%2Fej/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uswitch","download_url":"https://codeload.github.com/uswitch/ej/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229786999,"owners_count":18124014,"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":[],"created_at":"2024-12-15T06:12:28.983Z","updated_at":"2024-12-15T06:12:29.607Z","avatar_url":"https://github.com/uswitch.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ej\n\nA tool to convert from EDN to JSON.\n\n## Usage\n\n    $ ej \u003c some.edn \u003e some.json\n\nNote: no command line options (or even filenames) are (currently) accepted.\n\nOutput is one record per line.\n\n    $ cat drinks.edn\n    {:name \"milkshake\" :sizes [330 500 1000] :contents {:milk true :alcohol false}}\n    {:name \"latte\" :sizes [125 250] :contents {:milk true :alcohol false}}\n    {:name \"beer\" :sizes [284 568] :contents {:milk false :alcohol true}}\n    {:name \"white russian\" :sizes [100] :contents {:milk true :alcohol true}}\n    {:name \"water\" :sizes [1000] :contents {:milk false :alcohol false}}\n\n    $ ej \u003c drinks.edn\n    {\"contents\":{\"alcohol\":false,\"milk\":true},\"name\":\"milkshake\",\"sizes\":[330,500,1000]}\n    {\"contents\":{\"alcohol\":false,\"milk\":true},\"name\":\"latte\",\"sizes\":[125,250]}\n    {\"contents\":{\"alcohol\":true,\"milk\":false},\"name\":\"beer\",\"sizes\":[284,568]}\n    {\"contents\":{\"alcohol\":true,\"milk\":true},\"name\":\"white russian\",\"sizes\":[100]}\n    {\"contents\":{\"alcohol\":false,\"milk\":false},\"name\":\"water\",\"sizes\":[1000]}\n\n### jq\n\nej works well with [jq](http://stedolan.github.io/jq), a tool for command-line JSON processing.\n\nTo get pretty JSON from EDN:\n\n    $ ej \u003c some.edn | jq .\n\nTo query EDN from the command line:\n\n    $ cat drinks.edn | ej | jq -r 'select(.contents.milk) | .name'\n    milkshake\n    latte\n    white russian\n\n## Caveats\n\n* EDN tagging information is removed\n* Rational numbers are parsed, and become floats in JSON (the EDN spec doesn't mention rationals, but it looks as if it should)\n* keywords and symbols as map keys become strings\n* other types used as map keys become JSON-encoded strings\n\n## Prerequisites\n\n* The Haskell Stack\n\n    $ curl -sSL https://get.haskellstack.org/ | sh\n\n(Be prepared for a wait)\n\n## Installation\n\n    $ git clone https://github.com/uswitch/ej.git\n    $ cd ej\n    $ stack setup\n    $ stack install\n\nwhich, if all goes well, will create `~/.local/bin/ej`. It may be a\ngood idea to put `~/.local/bin` in your `PATH`.\n\n## Motivation\n\n* Needed a fast way to convert streams of EDN to JSON, to get benefit of tools such as jq.\n* Clojure takes too long to start for a command line tool.\n* There's a Go implementation, but its licence is unclear.\n* I'm a Haskell beginner, so I thought this would make a good first (useful) project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuswitch%2Fej","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuswitch%2Fej","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuswitch%2Fej/lists"}