cline/json

Memory-efficient pull parser for large JSON sources in Laravel and PHP applications.

Maintainers

Package info

github.com/faustbrian/json

pkg:composer/cline/json

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-06-04 01:11 UTC

This package is auto-updated.

Last update: 2026-06-04 01:20:05 UTC


README

GitHub Workflow Status Latest Version on Packagist Software License Total Downloads

json

Memory-efficient pull parser for large JSON sources in Laravel and PHP applications.

Requirements

  • PHP 8.5+

Installation

composer require cline/json

Quick Example

use Cline\Json\JsonParser;

$records = JsonParser::parse(storage_path('app/records.json'))
    ->pointer('/data')
    ->toArray();

Documentation

Supported API Surface

The stable, consumer-facing API is centered on:

  • Cline\Json\JsonParser
  • the parseJson() helper
  • string-based pointer selection through pointer(), pointers(), lazyPointer(), and lazyPointers()
  • decoder customization through Cline\Json\Decoders\Decoder, JsonDecoder, and SimdjsonDecoder
  • package exceptions that implement Cline\Json\Exceptions\JsonParserException

Lazy traversal may yield nested Cline\Json\Tokens\Parser instances. That nested parser type is part of the lazy traversal contract.

Lower-level namespaces such as Concerns\*, ValueObjects\*, Sources\StreamWrapper, Sources\JsonResource, and most token support classes exist for implementation and integration purposes. They are autoloaded, but they are not the primary consumer API this package optimizes around.

Benchmarks

The package ships with throughput and memory benchmarks. See BENCHMARK.md for when to use eager decode, eager parser materialization, and lazy/selective traversal.

Change log

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please use the GitHub security reporting form rather than the issue queue.

Credits

License

The MIT License. Please see License File for more information.