Phel library for converting Phel datastructures to and from JSON.
This Phel library is a wrapper library around PHP json_encode
and json_decode
functions.
It converts Phel datastructures and basic types to a format that PHP understands before calling (php/json_encode)
.
It generates valid Phel datastructures (map, vector) from given JSON strings using (php/json_decode)
.
From the command line:
composer require mabasic/phel-json
This Phel library has two public method:
(json/encode value {:depth 512 :flags 0})
(json/decode json {:depth 512 :flags 0})
(ns your\namespace
(:require mabasic\json\json))
(def result (json/encode {:name "Phel" :type "lisp"}))
# result
# {"name": "Phel", "type": "lisp"}
(println (json/decode result))
# output
# {:name "Phel" :type "Lisp"}
composer install
composer test
I would like to extend my thanks to the following sponsors & backers for funding my open-source journey. If you are interested in becoming a sponsor or backer, please visit the Backers page.
Thank you for considering contributing to Phel-json! The contribution guide can be found Here.
In order to ensure that the open-source community is welcoming to all, please review and abide by the Code of Conduct.
Phel-json is open-source software licensed under the MIT license.