Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

lambda-rpc

1.2.0 • Public • Published

Build Status Coverage Status Dependency Status devDependency Status

lambda-rpc

Example usage

import LambdaRpc from "lambda-rpc";
import {exec} from "child_process";
 
var lambdaRpc = new LambdaRpc()
    .methods({
        cowSay: function (message) {
            return new Promise(function (resolve, reject) {
                exec(`cowsay ${message}`, function (err, stdout) {
                    if (err) {
                        reject(err);
                    } else {
                        resolve(stdout);
                    }
                });
            });        }
    })
    .methods({
        echo: function (message) {
            return message;
        }
    });
 
export var handler = lambdaRpc.getRouter();

Keywords

none

install

npm i lambda-rpc

Downloadsweekly downloads

9

version

1.2.0

license

Apache-2.0

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar