Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/librecat/catmandu-fix-cmd

Pipe data to be fixed through an external process
https://github.com/librecat/catmandu-fix-cmd

Last synced: 4 days ago
JSON representation

Pipe data to be fixed through an external process

Awesome Lists containing this project

README

        

# NAME

Catmandu::Fix::cmd - pipe data to be fixed through an external process

# DESCRIPTION

This [Catmandu::Fix](https://metacpan.org/pod/Catmandu::Fix) passes data as a JSON object to an external process over
stdin and reads a JSON object from it's stdout.

# SYNOPSIS

my $fixer = Catmandu::Fix->new(fixes => [
# pipe data through the jq command-line json processor
# keeping only the title field
'cmd("jq -c -M {title}")',
# ...
]);

# a canonical external program in perl
use JSON;
while () {
my $data = decode_json($_);
# ...
print encode_json($data);
}

# CONTRIBUTORS

Nicolas Steenlant, ``

Jakob Voss `jakob.voss at gbv.de`

# LICENSE

This is free software; you can redistribute it and/or modify it under the same
terms as the Perl 5 programming language system itself.