Skip to content

Library for converting Phel data structures to and from JSON.

License

Notifications You must be signed in to change notification settings

mabasic/phel-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Phel-json

Phel library for converting Phel datastructures to and from JSON.

Become a Patron

Overview

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).

Installation

From the command line:

composer require mabasic/phel-json

Usage

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"}

For developers

composer install
composer test

Sponsors & Backers

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.

Contributing

Thank you for considering contributing to Phel-json! The contribution guide can be found Here.

Code of Conduct

In order to ensure that the open-source community is welcoming to all, please review and abide by the Code of Conduct.

License

Phel-json is open-source software licensed under the MIT license.

About

Library for converting Phel data structures to and from JSON.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages