-
-
21 Mar 2022 15:23:34 UTC
- Distribution: Catmandu
- Module version: 1.2019
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (36)
- Testers (409 / 0 / 5)
- Kwalitee
Bus factor: 4- 87.59% Coverage
- License: perl_5
- Perl: v5.14.0
- Activity
24 month- Tools
- Download (814.59KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 19 contributors- Nicolas Steenlant, C<< <nicolas.steenlant at ugent.be> >>
-
Christian Pietsch
-
Dave Sherohman
-
Doug Bell
-
EC2 Default User
-
Jakob Voß
-
Johann Rolschewski
-
Magnus Enger
-
Matthias Vandermaesen
-
Mohammad S Anwar
-
Nicolas Franck
-
Patrick Hochstenbach
-
Pieter De Praetere
-
Snorri Briem
-
Stefan Weil
-
Tom Hukins
-
Upasana Shukla
-
Vitali Peil
-
Zakariyya Mughal
- Dependencies
- Any::URI::Escape
- App::Cmd
- CGI::Expand
- Class::Method::Modifiers
- Clone
- Config::Onion
- Cpanel::JSON::XS
- Data::Compare
- Data::Util
- HTTP::Request
- Hash::Merge::Simple
- IO::Handle::Util
- LWP::UserAgent
- List::MoreUtils
- Log::Any
- Log::Any::Adapter
- MIME::Types
- Module::Build
- Module::Info
- Moo
- MooX::Aliases
- Package::Stash
- Parser::MGC
- Path::Iterator::Rule
- Path::Tiny
- Role::Tiny
- Role::Tiny::With
- String::CamelCase
- Sub::Exporter
- Sub::Quote
- Text::CSV
- Text::Hogan::Compiler
- Throwable
- Time::HiRes
- Try::Tiny::ByClass
- URI
- URI::Template
- UUID::Tiny
- Unicode::Normalize
- YAML::XS
- asa
- namespace::clean
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Catmandu::Exporter::JSON - a JSON exporter
SYNOPSIS
# From the command line catmandu convert YAML to JSON --pretty 1 < input.yml # Export in the line-delimited format catmandu convert YAML to JSON --line_delimited 1 < input.yml # In a Perl script use Catmandu; my $exporter = Catmandu->exporter('JSON', fix => 'myfix.txt'); $exporter->add_many($arrayref); $exporter->add_many($iterator); $exporter->add_many(sub { }); $exporter->add($hashref); printf "exported %d items\n" , $exporter->count;
DESCRIPTION
This Catmandu::Exporter exports items serialized in JSON format. By default each item is printed condensed on one line.
CONFIGURATION
- file
-
Write output to a local file given by its path or file handle. Alternatively a scalar reference can be passed to write to a string and a code reference can be used to write to a callback function.
- fh
-
Write the output to an IO::Handle. If not specified, Catmandu::Util::io is used to create the output handle from the
file
argument or by using STDOUT. - fix
-
An ARRAY of one or more fixes or file scripts to be applied to exported items.
- encoding
-
Binmode of the output stream
fh
. Set to ":utf8
" by default. - pretty
-
Pretty-print JSON
- indent
- space_before
- space_after
- canonical
-
JSON serialization options
- array
-
Structure the data as a JSON array. Default is
1
. - line_delimited
-
Export items as newline delimited JSON. Default is
0
. Thearray
,pretty
,indent
,space_before
andspace_after
options will be ignored ifline_delimited
is1
.
SEE ALSO
Module Install Instructions
To install Catmandu, copy and paste the appropriate command in to your terminal.
cpanm Catmandu
perl -MCPAN -e shell install Catmandu
For more information on module installation, please visit the detailed CPAN module installation guide.