Node API
In addition to a CLI, Checkup also provides a Node API. This allows for programmatic access to Checkup's functionality.
You can import Checkup's task runner class and use it to run tasks. For example:
- TypeScript
- JavaScript
/tasks/demo-task.ts
import { CheckupTaskRunner, getFormatter } from '@checkup/cli';
let taskRunner = new CheckupTaskRunner({
// pass options here
});
let log = await taskRunner.run();
let formatter = getFormatter({
// pass options here
});
formatter.format(log);
/tasks/demo-task.js
const { CheckupTaskRunner, getFormatter } = require('@checkup/cli');
let taskRunner = new CheckupTaskRunner({
// pass options here
});
let log = await taskRunner.run();
let formatter = getFormatter({
// pass options here
});
formatter.format(log);
See the following API documentation for more information.