PHPackages                             bcncommerce/json-stream - 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. bcncommerce/json-stream

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

bcncommerce/json-stream
=======================

A bundle of tools to work with JSON in PHP

0.4.2(5y ago)642.2M—2%10[2 issues](https://github.com/skolodyazhnyy/json-stream/issues)3MITPHPPHP &gt;=7.3

Since Apr 1Pushed 5y ago4 watchersCompare

[ Source](https://github.com/skolodyazhnyy/json-stream)[ Packagist](https://packagist.org/packages/bcncommerce/json-stream)[ RSS](/packages/bcncommerce-json-stream/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (8)Used By (3)

PHP JSON Component
==================

[](#php-json-component)

[![Build Status](https://github.com/skolodyazhnyy/json-stream/workflows/CI/badge.svg)](https://github.com/skolodyazhnyy/json-stream/actions?query=workflow%3ACI)

This project is a rewritten fork of few very nice JSON libs for PHP:

- [salsify/jsonstreamingparser](https://github.com/salsify/jsonstreamingparser) - Json Stream Parser
- [rayward/json-stream](https://github.com/rayward/json-stream) - Json Stream Writer

JSON Writer
-----------

[](#json-writer)

There is an example of product catalog export using JSON Writer

```
$fh = fopen($filename, "w");
$writer = new Writer($fh);

$writer->enter(Writer::TYPE_OBJECT);                // enter root object
    $writer->write("catalog", $catalog['id']);      // write key-value entry
    $writer->enter("items", Writer::TYPE_ARRAY);    // enter items array
        foreach($catalog['products'] as $product) {
            $writer->write(null, array(             // write an array item
                'sku'  => $product['sku'],
                'name' => $product['name']
            ));
        }
    $writer->leave();                               // leave items array
$writer->leave();                                   // leave root object

fclose($fh);
```

**Output**

```
{"catalog":19,"items":[{"sku":"0001","name":"Product #1"},{"sku":"0002","name":"Product #2"}]}
```

JSON Reader
-----------

[](#json-reader)

Using JSON Reader you can easily read json generated by code above

```
$fh = fopen($filename, "r");

$reader = new Reader($fh);
$reader->enter(Reader::TYPE_OBJECT);                // enter root object
    $catalog['id'] = $reader->read("catalog");      // read catalog node
    $reader->enter("items", Reader::TYPE_ARRAY);    // enter item array
        while($product = $reader->read()) {         // read product structure
            $catalog['products'][] = $product;
        }
    $reader->leave();                               // leave item node
$reader->leave();                                   // leave root object

fclose($fh);
```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity54

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 62.1% 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 ~413 days

Recently: every ~613 days

Total

7

Last Release

1952d ago

PHP version history (2 changes)0.1.0PHP &gt;=5.3

0.4.2PHP &gt;=7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/b718cebb9677c634f8eff95f1da3cfc5f79469ebe4987bd0506693b18f7626dd?d=identicon)[skolodyazhnyy](/maintainers/skolodyazhnyy)

---

Top Contributors

[![skolodyazhnyy](https://avatars.githubusercontent.com/u/576301?v=4)](https://github.com/skolodyazhnyy "skolodyazhnyy (18 commits)")[![jdecool](https://avatars.githubusercontent.com/u/433926?v=4)](https://github.com/jdecool "jdecool (6 commits)")[![teohhanhui](https://avatars.githubusercontent.com/u/548843?v=4)](https://github.com/teohhanhui "teohhanhui (3 commits)")[![hotrush](https://avatars.githubusercontent.com/u/1247004?v=4)](https://github.com/hotrush "hotrush (2 commits)")

---

Tags

jsonparserstreamingwriterreader

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bcncommerce-json-stream/health.svg)

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

###  Alternatives

[salsify/json-streaming-parser

A streaming parser for JSON in PHP.

7766.7M15](/packages/salsify-json-streaming-parser)[clue/ndjson-react

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

15267.7M16](/packages/clue-ndjson-react)[pcrov/jsonreader

JSON Pull Parser

1451.2M5](/packages/pcrov-jsonreader)[cerbero/json-parser

Zero-dependencies pull parser to read large JSON from any source in a memory-efficient way.

803474.6k5](/packages/cerbero-json-parser)[veewee/xml

XML without worries

1835.9M29](/packages/veewee-xml)[dallgoot/yaml

Provides loader, dumper and an API for YAML content. Loader builds to equivalent data types in PHP 8.x

43185.8k6](/packages/dallgoot-yaml)

PHPackages © 2026

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