0.0.6 • Published 12 months ago

nodejs-functions v0.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

Functions for Node.js

Version Monthly Downloads

🌟 Features

  • execute a function whenever your scheduled job triggers

🚀 Installation

npm install nodejs-functions

🛠 Basic Usage

import { app } from 'nodejs-functions';

app.ScheduledTask('ScheduledFunction1', '* * * * * *', () => {
  console.log(`send 1 ${new Date().toISOString()}`);
});

or

import { app } from 'nodejs-functions';

function send2() {
  console.log(`send 2 ${new Date().toISOString()}`);
}

app.ScheduledTask('ScheduledFunction2', '* * * * * *', send2);

Configure Function Directories using .nfunc.json

{
  "directory": ["dist/test"],
  "ScheduledFunction1_DISABLE": true
}

How it run the function

Both file will later build to the dist folder which then give the path

  1. ./dist/example/example.js
  2. ./dist/example/example_2.js

Use the .nfunc.json to set the directory to dist/example folder and it will load every function inside individually.

The command below can be use to execute the functions

npx nfunc --config .nfunc.json

# recommended to have it in package.json script instead

Future Features

  • Queue trigger
  • DB trigger
  • Storage trigger
  • HTTP/HTTPS
0.0.6

12 months ago

0.0.5

12 months ago

0.0.4

12 months ago

0.0.3

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago