Trampo
Configurable job scheduler through well know file formats
Prerequisities
To run Trampo you will just need to have Nodejs (at least version 8) and NPM installed on your local machine.
Installing
You can install Trampo on your global scope:
npm i -g trampo
Or you can run it directly using npx:
npx trampo -F /path/to/config.json
Config files
Trampo uses JSON files to run the jobs. For now, it has support for 2 kinds of jobs: OneTimeJob and CronJob. They have very similar config files, the only thing that differentiates them, is that one-time job uses the when parameter and the cron job uses the period parameter.
Command Execution
There are 2 things that Trampo can run on the jobs scheduled. It can make an HTTP request or execute a command on your system.
HTTP Request:
{
url: string;
method: HttpMethod;
headers?: object;
body?: unknown;
params?: object;
}
Exec:
{
exec: string;
}
OneTimeJob Example
CronJobExample
Final config file
The final JSON config file that Trampo uses should have a CronJob or a OneTimeJOb or both, wrapped in an array:
Running the jobs
To run the jobs using Trampo is easy like that, you build your JSON config file like explained above, they run passing it as the argument:
trampo -F /path/to/config.json or trampo --file /path/to/config.json
Running the tests
Normal tests:
npm run test
Tests with file watch:
npm run test:tdd
Coverage test
npm run test:coverage
Building
npm run build
Built With
- Typescript
- Webpack
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
Authors
- Pedro Mutter - Initial work - MutterPedro
See also the list of contributors who participated in this project.
License
This project is licensed under the MIT License - see the LICENSE.md file for details