PHPackages                             cruxoft/bolt-json - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. cruxoft/bolt-json

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

cruxoft/bolt-json
=================

JSON wrapper library built on the Bolt Framework

0.4.0(4y ago)050Apache-2.0PHPPHP ^8.0

Since Apr 5Pushed 4y ago1 watchersCompare

[ Source](https://github.com/irwtdvoys/bolt-json)[ Packagist](https://packagist.org/packages/cruxoft/bolt-json)[ RSS](/packages/cruxoft-bolt-json/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (2)Versions (9)Used By (0)

Bolt-JSON (v0.4.0)
==================

[](#bolt-json-v040)

What is it?
-----------

[](#what-is-it)

A simple wrapper for dealing with JSON in PHP with built in error handling.

Installation
------------

[](#installation)

Can be installed using composer by running the following:

```
$ composer require cruxoft/bolt-json
```

Usage
-----

[](#usage)

Simple usage involves calling static `encode` and `decode` methods however initial work on an OOP interface has been included.

### Encode

[](#encode)

```
use Bolt\Json;

try
{
    $json = Json::encode(array("hello" => "world"));
}
catch (\Exception $exception)
{
    die($exception->getMessage());
}

var_dump($json);
```

Outputs:

```
string(17) "{"hello":"world"}"

```

### Decode

[](#decode)

```
use Bolt\Json;

try
{
    $json = Json::decode('{"hello":"world"}');
}
catch (\Exception $exception)
{
    die($exception->getMessage());
}

var_dump($json);
```

Outputs:

```
object(stdClass)#3 (1) {
  ["hello"]=>
  string(5) "world"
}

```

### Validate

[](#validate)

```
use Bolt\Json;

var_dump(Json::validate('{"hello":"world"}'));
var_dump(Json::validate('{"hello":"world"x}'));
```

Outputs:

```
bool(true)
bool(false)

```

### OOP

[](#oop)

The class constructor takes either encoded or decoded data and allows manipulation of the data and output.

Very much a work in progress.

```
use Bolt\Json;

$json = new Json(array("hello" => "world"));
var_dump($json->toString());
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~196 days

Recently: every ~165 days

Total

7

Last Release

1786d ago

PHP version history (2 changes)0.3.0PHP ^7

0.4.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/984365c8e13e63090196a89eca25d781bb2abd1a2c43f6dbe5cc62d0b8a65d80?d=identicon)[irwtdvoys](/maintainers/irwtdvoys)

---

Top Contributors

[![irwtdvoys](https://avatars.githubusercontent.com/u/1695516?v=4)](https://github.com/irwtdvoys "irwtdvoys (40 commits)")

---

Tags

jsonbolt

### Embed Badge

![Health badge](/badges/cruxoft-bolt-json/health.svg)

```
[![Health](https://phpackages.com/badges/cruxoft-bolt-json/health.svg)](https://phpackages.com/packages/cruxoft-bolt-json)
```

###  Alternatives

[justinrainbow/json-schema

A library to validate a json schema.

3.6k316.9M612](/packages/justinrainbow-json-schema)[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[jms/serializer

Library for (de-)serializing data of any complexity; supports XML, and JSON.

2.3k135.8M851](/packages/jms-serializer)[jms/serializer-bundle

Allows you to easily serialize, and deserialize data of any complexity

1.8k89.3M627](/packages/jms-serializer-bundle)[colinodell/json5

UTF-8 compatible JSON5 parser for PHP

30422.2M45](/packages/colinodell-json5)[clue/ndjson-react

Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.

15267.7M16](/packages/clue-ndjson-react)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
