0.0.9 • Published 5 years ago

streamjq v0.0.9

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

streamjq

Stream => JQ => Stream

Install

npm install --save streamjq

May need to install the following packages:

apt-get install libtool autoconf build-essential

Troubleshoot

May need to install the following if installation fails

sudo apt-get install autoconf libtool automake build-essential

Usage

const jq = require('streamjq')
const transformedStream = jq([READABLE_STREAM], [JQ_FILTER])
transformedStream.pipe(WRITABLE_STREAM)

Example

const fetch = require('node-fetch');
const jq = require('streamjq')
const stream = require('stream')
fetch("https://genesis.bitdb.network/q/1FnauZ9aUH2Bex6JzdcV4eNX7oLSSEbxtN/ewogICJ2IjogMywKICAicSI6IHsKICAgICJmaW5kIjoge30sCiAgICAibGltaXQiOiAxMAogIH0KfQ==", { headers: { key: "1KJPjd3p8khnWZTkjhDYnywLB2yE1w5BmU" } })
.then(function(res) {
  return res.json()
})
.then(function(res) {
  let s = new stream.Readable()
  s.push(JSON.stringify(res.c))
  s.push(null);
  jq(s, "[.[] | { b0: .out[0].b0, blk: .blk }]").pipe(process.stdout)
})
0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago