3.0.4 • Published 1 year ago

script-timer v3.0.4

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

Script Timer

Script Timer helps you run cron jobs right inside your application It can help you maintain things like sitemaps, archiving, backups etc.

Installation

Use the npm to install Script Timer.

npm install script-timer

Usage

const {Units, setupAndStart} = require('script-timer');

// setup commit and run intervals
let commitInterval = {unit: Units.HOUR, value: 1};
let runInterval = {unit: Units.DAY, value: 1};

// setup additional config
let config = {
    commitInterval: commitInterval,
    runInterval: runInterval,
    title: "users-archive", //any random name
    script: './scripts/archiveUsers.js', //filepath relative to your main project directory
    timesRun: 1 //number of times it should run, will run forever if not provided or set to 0     
}

// start the timer
setupAndStart(config)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

3.0.4

1 year ago

3.0.3

1 year ago

3.0.2

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

2.0.0

1 year ago

1.0.0

1 year ago