Helper for interacting with JSON Lines
composer require buchin/jltools
Here is some example. Currently only do one thing: add new field.
This script will add key and value pair to every line in json file
<?php
use Buchin\Jltools\Jltools;
$jltools = new Jltools;
$jltools->setPath('/Path/to/jsonline.jsonl');
$jltools->addField('key', 'value', 'output.jsonl');
If you want to add new feature to this package, please send a pull request. All pull request should come with it’s own test. I currently use kahlan for my testing purpose.