webpipe

1.0.0 • Public • Published

webpipe.js

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

BuildStatus GitHub file size in bytes

Installation

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

Browser

<script src="https://unpkg.com/webpipe/webpipe.min.js"></script>

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

<script src="https://unpkg.com/webpipe@0.4.5/webpipe.min.js"></script>

Node

Or, if you're using webpipe.js with node.js

$ npm [-g] install webpipe

Then require the "webpipe" module:

const webpipe = require('webpipe')

Usage

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.

webpipe.execute(url, inputs, callback)

The real workhorse is webpipe.execute(). Use it to make a request to your WebPipe of choice.

const url = 'https://webpip.es/calculate-square-root'
const inputs = { radicand: 9 }
 
webpipe.execute(url, inputs, (err, outputs) => {
  if (err) {
    throw new Error(err.message)
  }
  console.log(outputs)
})

Suggestions

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.

License

Unless attributed otherwise, everything is under the MIT License (see LICENSE for more info).

Readme

Keywords

none

Package Sidebar

Install

npm i webpipe

Weekly Downloads

1

Version

1.0.0

License

none

Unpacked Size

25.2 kB

Total Files

8

Last publish

Collaborators

  • matthewhudson