functions-io-core

0.24.0 • Public • Published

Functions-IO-Core

Functional Micro Framework

work in progress...

Minimalist functional framework for node.

Features

  • Focus on high performance
  • Input/Output with automatic validation

Installation

$ npm install functions-io-core

Usage

Create a subfolder in functions folder and generate package.json

$ npm init

example package.json

{
  "name": "sum",
  "version": "1.0.0",
  "description": "sum x + y",
  "main": "index.js"
}

create file index.js

module.input = {
    x:{type:"integer", required:true},
    y:{type:"integer", required:true}
};
module.output = {
    value:{type:"integer"}
};

module.exports = function(context, message, callBack){
    callBack(null, {value: message.x + message.y});
};

Example

const moduleFactory = require("functions-io-core").buildModuleFactory();

moduleFactory.requireAsync("uuid", "3.2.1")
    .then(function(module){
        console.log("module", module.v4());
        console.log("module", module.v4());
        console.log("module", module.v4());
    }).catch(function(err){
        console.log("erro", err);
    });

Package Sidebar

Install

npm i functions-io-core

Weekly Downloads

0

Version

0.24.0

License

MIT

Unpacked Size

78.2 kB

Total Files

13

Last publish

Collaborators

  • rogeriodegoiania