Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

pipetree

0.1.0 • Public • Published

pipetree

Build Status Build Status Coverage Status

Utility library to enable easy piping between nodejs programs and tree traversing of graphs

const select = require("pipetree").select
const listen = require("pipetree").listen
 
// get a function to traverse a tree - this one returns the first occurance
// of the field "browser_download_url"
const getDownloadUrl = select.querySelector("browser_download_url")
 
// use this function when the piped input is read
select.use = () => {
    // use the querySelector from select on the parsed JSON piped input
    const downloadUrl = getDownloadUrl( listen.collectJSON() )
    console.log(downloadUrl)
}
 
// attach select to handle the "listen" output when read
select.start()
// start listening for piped input
listen.start()

License

MIT

Keywords

none

install

npm i pipetree

Downloadsweekly downloads

3

version

0.1.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar