PHPackages                             im0rtality/jsonstreamingparser - 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. im0rtality/jsonstreamingparser

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

im0rtality/jsonstreamingparser
==============================

A streaming parser for JSON in PHP.

v4.0.0(11y ago)134.6k↓36.7%2[1 PRs](https://github.com/Im0rtality/jsonstreamingparser/pulls)MITPHPPHP &gt;=5.3

Since Oct 31Pushed 10y ago1 watchersCompare

[ Source](https://github.com/Im0rtality/jsonstreamingparser)[ Packagist](https://packagist.org/packages/im0rtality/jsonstreamingparser)[ Docs](https://github.com/salsify/jsonstreamingparser)[ RSS](/packages/im0rtality-jsonstreamingparser/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (5)Used By (0)

[![Build Status](https://camo.githubusercontent.com/c3a0e5c7d24778c9bcfd40bb2f052263d59865215164c7feb48109dc5488ef3f/68747470733a2f2f7472617669732d63692e6f72672f496d307274616c6974792f6a736f6e73747265616d696e677061727365722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Im0rtality/jsonstreamingparser)

Not invented here
=================

[](#not-invented-here)

Code forked from  and some fixed added:

- Removed file\_position callback from listener (we did not need it and it gave significant performance boost)
- PSR2

Features
--------

[](#features)

- Stream based - low memory footprint does not grow with file size
- Similar to [SAX parser](http://en.wikipedia.org/wiki/Simple_API_for_XML)

Known drawbacks
---------------

[](#known-drawbacks)

- Performance is not as good as it should be (throughput - ~1MB per 9 secs, VirtualBox, Debian 7 on 4.3GHz CPU, single core)

Usage
-----

[](#usage)

To use the `JsonStreamingParser` you just have to implement the `JsonStreamingParser\Listener` interface. You then pass your `Listener` into the parser. For example:

```
$stream = fopen('doc.json', 'r');
$listener = new YourListener();
try {
  $parser = new Parser($stream, $listener);
  $parser->parse();
} catch (Exception $e) {
  fclose($stream);
  throw $e;
}
```

That's it! Your `Listener` will receive events from the streaming parser as it works.

License
-------

[](#license)

MIT License

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~82 days

Total

4

Last Release

4336d ago

Major Versions

v1.0 → v2.02013-12-13

v2.0 → v3.02014-05-27

v3.0 → v4.0.02014-07-04

### Community

Maintainers

![](https://www.gravatar.com/avatar/6d0c2ed4ef6020c0ba50e9f5b30972ea9ec5b17a0c82271ffae81125dd3c2610?d=identicon)[Im0rtality](/maintainers/Im0rtality)

---

Top Contributors

[![gonzofy](https://avatars.githubusercontent.com/u/52811?v=4)](https://github.com/gonzofy "gonzofy (24 commits)")[![Im0rtality](https://avatars.githubusercontent.com/u/1804210?v=4)](https://github.com/Im0rtality "Im0rtality (19 commits)")[![Magomogo](https://avatars.githubusercontent.com/u/728657?v=4)](https://github.com/Magomogo "Magomogo (19 commits)")[![jchamberlain](https://avatars.githubusercontent.com/u/3923548?v=4)](https://github.com/jchamberlain "jchamberlain (1 commits)")[![jredburn](https://avatars.githubusercontent.com/u/884775?v=4)](https://github.com/jredburn "jredburn (1 commits)")[![Kolyunya](https://avatars.githubusercontent.com/u/2682768?v=4)](https://github.com/Kolyunya "Kolyunya (1 commits)")

---

Tags

jsonparserstreaming

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/im0rtality-jsonstreamingparser/health.svg)

```
[![Health](https://phpackages.com/badges/im0rtality-jsonstreamingparser/health.svg)](https://phpackages.com/packages/im0rtality-jsonstreamingparser)
```

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

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

JSON Pull Parser

1451.2M5](/packages/pcrov-jsonreader)[bcncommerce/json-stream

A bundle of tools to work with JSON in PHP

642.2M3](/packages/bcncommerce-json-stream)[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)[laktak/hjson

JSON for Humans. A configuration file format with relaxed syntax, fewer mistakes and more comments.

86233.7k12](/packages/laktak-hjson)

PHPackages © 2026

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