@jacksontian/tiny-function

0.1.0 • Public • Published

tiny-function

The tiny function compute framework for Node.js.

Node.js CI codecov NPM version npm download

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @jacksontian/tiny-function

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

4.64 kB

Total Files

4

Last publish

Collaborators

  • jacksontian