jsonyx/jsonyx

(C)oncept-Labs Extended JSON Pluggable parser

Maintainers

Package info

github.com/jsonyx/jsonyx

pkg:composer/jsonyx/jsonyx

Statistics

Installs: 24

Dependents: 0

Suggesters: 4

Stars: 0

Open Issues: 0

1.0.1.6 2025-03-13 23:35 UTC

This package is not auto-updated.

Last update: 2026-03-27 05:07:15 UTC


README

jsonyx is a powerful JSON manipulation library for PHP. It provides an easy-to-use API for parsing, generating, and transforming JSON data. It also supports plugins from the pluggarray/pluggarray package, offering an easy static API in the Facade/Jsonyx class.

Features

  • Simple and intuitive API
  • High performance
  • Support for complex JSON structures
  • Flexible and extensible
  • Plugin support via pluggarray/pluggarray

Installation

You can install jsonyx via Composer:

composer require jsonyx/jsonyx

Usage

Here is a basic example of how to use jsonyx:

use Jsonyx\Facade\Jsonyx;

$json = '
    {
        "@import": "common/constants.json",
        "@const": {
            "FOO": "foo",
            "BAR": "bar"
        },
        "foo-refs": {
            "reference-node": {
                ...
            }
        },
        "user": {
            "name": "${user.name}",
            "age": 30,
            "foo": "@const(FOO) and @const(BAR)",
            "baz": "env value: @env(BAZ)",
            "ref": "@reference(foo-refs.reference-node),
            "address": "@include(user/${user.id}/address.json)"
        }
    }
';
$userData = [
    'id' => 1,
    'name': 'John Doe'
];

$jsonyx = \Jsonyx\Facade\Jsonyx::Jsonyx($userData); // or new Jsonyx($userData)

$jsonyx->withPlugin(
    function()
)

Contributing

We welcome contributions! Please read our contributing guidelines for more details.

License

This project is licensed under the MIT License. See the LICENSE file for more information.