Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mabasic/phel-json
Library for converting Phel data structures to and from JSON.
https://github.com/mabasic/phel-json
hacktoberfest json library phel
Last synced: 2 months ago
JSON representation
Library for converting Phel data structures to and from JSON.
- Host: GitHub
- URL: https://github.com/mabasic/phel-json
- Owner: mabasic
- License: mit
- Created: 2021-01-10T19:41:46.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-10-25T06:42:59.000Z (about 2 years ago)
- Last Synced: 2024-10-09T19:51:44.225Z (2 months ago)
- Topics: hacktoberfest, json, library, phel
- Language: PHP
- Homepage:
- Size: 33.2 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# Phel-json
Phel library for converting [Phel](https://phel-lang.org/) datastructures to and from JSON.
[![Become a Patron](https://img.shields.io/badge/Become%20a-Patron-f96854.svg?style=for-the-badge)](https://www.patreon.com/laravelista)
## 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:
```bash
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})````phel
(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](https://mariobasic.com/backers).
## Contributing
Thank you for considering contributing to Phel-json! The contribution guide can be found [Here](https://mariobasic.com/contributing).
## 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](https://mariobasic.com/code-of-conduct).
## License
Phel-json is open-source software licensed under the [MIT license](https://opensource.org/licenses/MIT).