Group
Extension

Matches 2

JSON-Builder ( K/KN/KNI/JSON-Builder-0.04.tar.gz, KNI, 2015; MetaCPAN )
JSON-Builder/JSON/Builder.pm ( view source; MetaCPAN )
=head1 NAME

JSON::Builder - to build large JSON with temp files when memory limit, and compress optionaly.

=head1 SYNOPSIS

 use JSON::Builder;
 
 my $json = JSON::XS->new()->utf8(1)->ascii(1);
 my 
empfile();
 unlink $filename;
 
 my $builder = JSON::Builder->new(json => $json, fh => $fh);
 or
 my $builder = JSON::Builder::Compress->new(json => $json, fh => $fh); # Compress, Base64
  
 my $fv = 
ek(0,0);
 print <$fh>;

=head1 MOTIVATION

Task: to create JSON while having the memory limitations.

If you have only one large value in JSON, or, large values are created one by one, you can use the
JSON-Builder ( K/KN/KNI/JSON-Builder-0.04.tar.gz, KNI, 2015; MetaCPAN )
JSON-Builder/test.pl ( view source; MetaCPAN )
ings;


use JSON::XS;
use File::Temp qw(tempfile);

use Compress::Zlib;
use MIME::Base64;
use URI::Escape;


use Test::More tests => 5;

BEGIN { use_ok( 'JSON::Builder' ) }

my $json = JSON::XS->new()
INK => 1);

	my $builder = JSON::Builder->new(
		json    => $json,
		fh      => $fh,
		read_in => 1000*57
	);

	build($fh, $builder);

	my $r = read_fh($fh);
	is_deeply($json->decode($r), $j, "Simple"
file(UNLINK => 1);
	my ($fh_plain) = tempfile(UNLINK => 1);

	my $builder = JSON::Builder::Compress->new(
		json     => $json,
		fh       => $fh,
		read_in  => 1000*57,
		fh_plain => $fh_plain, 
	);


Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.