Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/webpipes/webpipe.js
JavaScript library for WebPipes. Use with Node.js, in the browser, or the command-line.
https://github.com/webpipes/webpipe.js
api api-client isomorphic isomorphic-javascript javascript javascript-library webpipe
Last synced: about 2 months ago
JSON representation
JavaScript library for WebPipes. Use with Node.js, in the browser, or the command-line.
- Host: GitHub
- URL: https://github.com/webpipes/webpipe.js
- Owner: webpipes
- License: mit
- Created: 2012-06-14T18:57:45.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2022-01-22T08:26:20.000Z (over 2 years ago)
- Last Synced: 2024-07-04T01:08:07.212Z (3 months ago)
- Topics: api, api-client, isomorphic, isomorphic-javascript, javascript, javascript-library, webpipe
- Language: CoffeeScript
- Homepage:
- Size: 549 KB
- Stars: 15
- Watchers: 5
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - webpipes/webpipe.js - JavaScript library for WebPipes. Use with Node.js, in the browser, or the command-line. (javascript)
README
# [webpipe.js](https://github.com/webpipes/webpipe.js)
Javascript library for working with WebPipes. Use with Node.js or in the
browser.[![Build
Status](https://api.travis-ci.org/webpipes/webpipe.js.svg?branch=master)](https://travis-ci.org/webpipes/webpipe.js)
[![Bundle Size](https://badgen.net/bundlephobia/minzip/webpipe)](https://bundlephobia.com/result?p=webpipe)## 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
Automatically include the most recent release:
```html```
Or, use a specific version by replacing
x.x.x
:```html
```
### Node
Or, if you're using webpipe.js with node.js
```sh
$ npm i webpipe --save
```Then require the "webpipe" module:
```javascript
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/](https://github.com/webpipes/webpipe.js/blob/master/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.```javascript
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).