openfaas

NodeJS wrapper around the OpenFaaS Gateway API w/ some additional helper functions

Showing:

Popularity

Downloads/wk

0

GitHub Stars

8

Maintenance

Last Commit

4yrs ago

Contributors

2

Package

Dependencies

1

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

XO code
style OpenFaaS

Usage
const OpenFaaS = require('openfaas')

const openfaas = new OpenFaaS('http://localhost:8080')

openfaas
    .deploy(
        'yolo', // name your function
        'hello-serverless' // choose the Docker image
        'func_functions', // choose your network (optional)
    )
    .then(x => console.log(x))
    .catch(err => console.log(err))

openfaas
    .invoke(
        'yolo', // function name
        'hello world', // data to send to function
        true, // should response be JSON? Optional, default is false
        false // should the response by binary? Optional, default is false
    )
    .then(x => console.log(x)) // handle response
    .catch(err => console.log(err))

openfaas
    .remove('yolo')
    .then(x => console.log(x)) // handle response
    .catch(err => console.log(err))

openfaas
    .compose('initial data', [
        'func_nodeinfo',
        'func_echoit',
        'func_wordcount'
    ])
    .then(x => console.log(x.body)) // handle final output
    .catch(err => console.log(err))

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial