webpipe.js

JavaScript library for interacting with WebPipes.

WebPipes are tiny HTTP programs that do one thing and do it well. They fill in the gaps. Need a proxy? Need to convert Markdown to HTML? Give a WebPipe some input, and it'll give you some output. They're a handy tool to have in your arsenal.

Learn more at webpipes.org →

Usage Example

WebPipe.js exposes two methods: webpipe.options() and webpipe.execute().

Click run below each example to see the result. Edit the code and test it again.

webpipe.options(url, callback)

This is a convenience function that returns the JSON descriptor for the WebPipe in question.

var blockURL = "http://block-parse-markdown.herokuapp.com/";
webpipe.options(blockURL, function (err, data) {
  if (err) {
    console.log("Error: ", err);
  } else {
    // Prints the webpipe.json config for the Parse Markdown webpipe.
    console.log(data);
  }
});
 


    

webpipe.execute(url, inputs, callback)

The real workhorse is webpipe.execute(). This handles the dirty work of executing a WebPipe.

var blockURL = "http://block-parse-markdown.herokuapp.com/";
webpipe.execute(blockURL, { markdown: "*hello world*" }, function (err, data) {
  if (err) {
    console.log("Error: ", err);
  } else {
    // Prints the outputs of the WebPipe.
    console.log(data);
  }
});