@jacksontian/tiny-function
v0.1.0
Published
My Function Compute framework
Downloads
4
Readme
tiny-function
The tiny function compute framework for Node.js.
Installation
npm install @jacksontian/tiny-function --save
Usage
import { createFunction, read } from '@jacksontian/tiny-function';
const fun = createFunction(async (req, res) => {
res.writeHead(200);
const body = await read(req, 'utf8');
res.end(body);
});
// start function
await fun.start();
// call the function
const { body } = await fun.call({
message: 'Hello world!'
});
console.log(body);
License
The MIT License.