buchin/jltools

Helper for interacting with JSON Lines

dev-master 2016-11-09 11:05 UTC

This package is auto-updated.

Last update: 2024-04-15 18:14:55 UTC


README

Helper for interacting with JSON Lines

Installation

composer require buchin/jltools

Example

Here is some example. Currently only do one thing: add new field.

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');

Pull Request

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.