https://github.com/jthomas/whiskify
Utility class to help running JavaScript functions as OpenWhisk Actions.
https://github.com/jthomas/whiskify
Last synced: over 1 year ago
JSON representation
Utility class to help running JavaScript functions as OpenWhisk Actions.
- Host: GitHub
- URL: https://github.com/jthomas/whiskify
- Owner: jthomas
- License: mit
- Created: 2016-04-06T14:48:13.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-02-16T16:27:32.000Z (over 9 years ago)
- Last Synced: 2025-01-25T04:27:00.434Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# whiskify
Utility class to help running JavaScript functions as [OpenWhisk](https://github.com/openwhisk/openwhisk) Actions.
## why?
"Serverless" cloud platforms let us create simple "microservices" from JavaScript functions.
This library helps you convert normal JavaScript functions to ephemeral "microservices" and interact with them as local functions.
We can now choose to move computations from the local machine to a scalable cloud platform with minimal code changes.
## installation
```
npm install whiskify
```
## usage
```
const whiskify = require('whiskify')({api: 'https://', api_key: '...', namespace: '...'})
const action = whiskify(function (item) { return item + 1; })
action(1).then(function (result) {
// == 2
})
action.map([1, 2, 3, 4]).then(function (result) {
// == [2, 3, 4, 5]
})
action.delete()
```
## limitations
OpenWhisk Actions currently execute using Node.js v6.9.1. Functions must not use features not available on this platform, e.g. async/await.