partpipe - Applying unix filter to parts of input stream

(c)GoogleCustomSearch

Applying unix filter to parts of input stream.

>cat some.js

var html=`
@PARTPIPE@|md2html
# Hello World
This is a greeting application.
@PARTPIPE@
`;

var text=`
Colors:
@PARTPIPE@|sort|uniq
Blue
Red
Green
Red
Blue
@PARTPIPE@
`;
>cat some.js|partpipe

var html=`
<h1>Hello World</h1>

<p>This is a greeting application.</p>
`;

var text=`
Colors:
Blue
Green
Red
`;

Install

sudo npm install -g partpipe

Usage

partpipe <options>
version -
Copyright(c) 2017,kssfilo(https://kanasys.com/gtech/)

options:
    -d:debug
    -f<string>:use <string> as block seperator(default:@PARTPIPE@)
    -i:don't process indents

example:
    >cat example.js

    var html=`
    @PARTPIPE@|md2html
    # Hello World
    This is a greeting application.
    @PARTPIPE@
    `;

    >cat example.js|partpipe

    var html=`
    <H1>Hello World</H1>
    <p>This is a greeting application.</p>
    `;

inline:
    >cat example.text

    Name: @PARTPIPE@|sed 's/World/Earth/';Hello World@PARTPIPE@

    >cat example.text|partpipe

    Name: Hellow Earth

Use as module

var partpipe=require("partpipe");

var input=`Colors:
@PARTPIPE@|sort|uniq
Red
Blue
Green
Blue
Red
@PARTPIPE@`;

partpipe(input).then((result)=>console.log(result));

Change Log

kanasys.com > Economizing Technology > partpipe - Applying unix filter to parts of input stream