edn2json
Convert EDN format to JSON format.
Installation
sudo npm install -g edn2json # CLI. npm install edn2json # NodeJS.
Usage
To use as CLI
edn2json [path-to-edn-input]
By default, it will output JSON with the same filename as the EDN file but with '.json' extension, which can be customized by:
edn2json [path-to-edn-input] -o [path-to-json-output]
To use in NodeJS
const parser = ; var ednString = '[{"foo" "bar"}]';var data = parser;var jsonString = JSON; // [{"foo":"bar"}].
To use in browser
First install pegjs compiler and compile convert.pegjs
:
sudo npm install -g pegjspegjs --format globals --export-var [variable-name] -o [path-to-js-output] convert.pegjs
Then in the HTML:
<!-- Suppose the js output is edn-parser.js and variable name is ednParser. -->