Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dotnetcarpenter/pipetree
Utility library to enable easy piping between nodejs programs and tree traversing of graphs
https://github.com/dotnetcarpenter/pipetree
Last synced: 4 days ago
JSON representation
Utility library to enable easy piping between nodejs programs and tree traversing of graphs
- Host: GitHub
- URL: https://github.com/dotnetcarpenter/pipetree
- Owner: dotnetCarpenter
- License: mit
- Created: 2016-10-18T15:07:56.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-04T18:32:47.000Z (over 6 years ago)
- Last Synced: 2024-12-04T16:09:36.594Z (21 days ago)
- Language: JavaScript
- Size: 126 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pipetree
[![Build Status](https://travis-ci.org/dotnetCarpenter/pipetree.svg?branch=master)](https://travis-ci.org/dotnetCarpenter/pipetree)
[![Build Status](https://ci.appveyor.com/api/projects/status/yxqj4kad6trefnj0/branch/master?svg=true)](https://ci.appveyor.com/project/dotnetCarpenter/pipetree/branch/master)
[![Coverage Status](https://coveralls.io/repos/github/dotnetCarpenter/pipetree/badge.svg?branch=master)](https://coveralls.io/github/dotnetCarpenter/pipetree?branch=master)*Utility library to enable easy piping between nodejs programs and tree traversing of graphs*
```js
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