0.2.4 • Published 1 year ago

cron-module-actions v0.2.4

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Cron Module Actions

A cron helper that imports a given folder

$ npm install -g cron-module-actions

Usage

Create a simple module

Modules are javascript files that export name, description, schedule, author and action properties. All should be strings, except action that should be a void function.

schedule prop must be a valid cron time format.

export const name = "Name";
export const description = "Description";
export const schedule = "1 * * * * *";
export const author = "moshmage@gmail.com"

export function action() {
  console.log(`Hello!`, new Date());
}

Point the cli to the folder

$ cma ./path/to/folder/with/modules

Alternatively you can import the cma by hand on your code

cronModuleActions(
  /* only .js modules will be imported */
  await getModules(`file/to/modules`),

  /* muted, if false will console.log information */
  true
)
0.2.1

1 year ago

0.2.0

1 year ago

0.1.7

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.2.4

1 year ago

0.1.4

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago