Harness the power of WebPipes in browser and server environments, as well as the command-line.


Javascript library for working with WebPipes. Use with Node.js or in the browser.

Just include the script. The webpipe object is automagically added to your environment. No need for new or any other sort of initialization.

<script src="webpipe.js"></script>

As a courtesy, webpipejs.org offers a compressed and CDN-hosted version:

<script src="http://cdn.webpipejs.org/latest.min.js"></script>

Or, use a specific version by replacing x.x.x:

<script src="http://cdn.webpipejs.org/x.x.x/webpipe.min.js"></script>

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.execute() and webpipe.options(). Use 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.

webpipe.execute("http://block-parse-markdown.herokuapp.com/", { markdown: "*hello world*" }, function (errdata) {
  if (err) return console.log("Error: ", err);
  // Prints the response of the Parse Markdown webpipe. 

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 @-

See examples/browser/index.html and examples/nodejs/index.js for more examples of usage.

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).