PHPackages                             rdx/jsonpathstreamer - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. rdx/jsonpathstreamer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rdx/jsonpathstreamer
====================

JSON streaming

1.0(8y ago)0361MITPHP

Since Nov 20Pushed 3y agoCompare

[ Source](https://github.com/rudiedirkx/jsonpathstreamer)[ Packagist](https://packagist.org/packages/rdx/jsonpathstreamer)[ RSS](/packages/rdx-jsonpathstreamer/feed)WikiDiscussions master Synced yesterday

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

JSON Path Streamer
==================

[](#json-path-streamer)

[![Build Status](https://camo.githubusercontent.com/5c111c79505ddd7b78e6adfdf469fa07fe6c92fdcd349fececc0dbac103c58f7/68747470733a2f2f7472617669732d63692e6f72672f72756469656469726b782f6a736f6e7061746873747265616d65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/rudiedirkx/jsonpathstreamer)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/933dc7e42fc1467f0902ffd912228928f02528baa95dd61e200b47d0a464645e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f72756469656469726b782f6a736f6e7061746873747265616d65722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/rudiedirkx/jsonpathstreamer/?branch=master)

Uses [salsify/jsonstreamingparser](https://github.com/salsify/jsonstreamingparser)to parse a JSON file, and stream its tokens. This package adds features to simplify that process.

In a very big JSON file, it's very important to know where the parser is, to know which few parts to keep. It provides an interface for that. For very simple JSON parsing, there's even a configurable method, without any more parse/JSON formatting logic.

See `examples/` for more examples. Run `examples/speed.php` for a speed comparison.

DIY - Surgical precision
------------------------

[](#diy---surgical-precision)

```
// MUST implement gotPath() and gotValue()
class MyListener extends \rdx\jsonpathstreamer\PathAwareJsonListener {
	public function gotPath(array $path) {
		// Ignore valueless paths (empty arrays etc)
	}

	public function gotValue(array $path, $value) {
		// Save only values within {"foo": {"bar": {...}}}
		if (array_slice($path, 0, 2) == ['foo', 'bar']) {
			// Ignore long "description" texts
			if (end($path) != 'description') {
				$this->rememberValue(array_slice($path, 2), $value);
			}
		}
	}

	// Optional
	public function stopAfter() {
		// Stop parsing after foo/bar because there's nothing I want there
		return ['#foo/bar/#'];
	}
}

```

Configurable - easy
-------------------

[](#configurable---easy)

```
// MUST implement getRules()
class MyListener extends \rdx\jsonpathstreamer\RegexConfigJsonListener {
	public function getRules() {
		// Save only "name", for all users into their original position
		return [
			'#^users/[^/]+/(name)(/|$)#',
			'#^offices/[^/]+/(name)(/|$)#',
		];
	}
}

```

Configurable - conversion
-------------------------

[](#configurable---conversion)

```
// MUST implement getRules()
class MyListener extends \rdx\jsonpathstreamer\RegexTargetConfigJsonListener {
	public function getRules() {
		// Save only "name", for all users and offices, into the same list
		return [
			'#^users/([^/]+)/(name)(/|$)#' => 'entities/$1/$2',
			'#^offices/([^/]+)/(name)(/|$)#' => 'entities/$1/$2',
		];
	}
}

```

###  Health Score

27

—

LowBetter than 47% 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

Unknown

Total

1

Last Release

3144d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/78549c1dc5c83ec0201c9afc66762c6d5bbf770291b12bae5a7a65350f950dba?d=identicon)[rudiedirkx](/maintainers/rudiedirkx)

---

Top Contributors

[![rudiedirkx](https://avatars.githubusercontent.com/u/168024?v=4)](https://github.com/rudiedirkx "rudiedirkx (21 commits)")

###  Code Quality

TestsBehat

### Embed Badge

![Health badge](/badges/rdx-jsonpathstreamer/health.svg)

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

###  Alternatives

[oro/platform

Business Application Platform (BAP)

642140.7k105](/packages/oro-platform)[swaggest/json-cli

JSON CLI tool (diff, rearrange, pretty print, minify, yaml convert, etc...)

8017.4k1](/packages/swaggest-json-cli)

PHPackages © 2026

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