Harness the power of WebPipes in browser and server environments, as well as the command-line.
Just include the script. The
webpipe object is automagically added to your environment. No need for
new or any other sort of initialization.
As a courtesy, webpipejs.org offers a compressed and CDN-hosted version:
Or, use a specific version by replacing
Or, if you're using webpipe.js with node.js
$ npm -g install webpipe
Then require the "webpipe" module:
var webpipe = require"webpipe";
webpipe.js exposes two methods:
webpipe.options() to load a WebPipe's Block Definition. It can be handy while debugging and/or learning about new WebPipes. See examples/ for usage examples.
The real workhorse is
webpipe.execute(). Use it to make a request to your WebPipe of choice.
webpipeexecute"" markdown: "*hello world*"if err return console.log"Error: " err;// Prints the response of the Parse Markdown webpipe.console.logdata;;
You can also use webpipe.js from the command-line. To use this feature make sure you install webpipe.js globally.
$ webpipe http://block-parse-markdown.herokuapp.com/ --markdown "*hello world*"
Store an alias (in ~/.webpipe) so you don't have to type the URL every time:
$ webpipe alias markdown http://block-parse-markdown.herokuapp.com/
Prefix a value with
@ to read from a file, or
- for STDIN:
$ webpipe markdown --markdown @README.md $ cat README.md | ./webpipe markdown --markdown @-
All comments in how to improve this library are very welcome. Feel free post suggestions to the Issue tracker, or even better, fork the repository to implement your own ideas and submit a pull request.
Unless attributed otherwise, everything is under the MIT License (see LICENSE for more info).