@monitio/boot v0.1.0-testing.js.multiplatform
boot
An ESM-first, Node-free framework for building bots of multiple different kind.
Features
- Modular event-driven bot core
- Works in Cloudflare Workers, browsers, and any ESM runtime
- Pluggable adapters (GitHub, Discord, etc.)
- Zero NodeJS dependencies
Usage
We recommend using esm.sh instead of NPM because not all environments have NodeJS and NPM installed. We only put it in an NPM package so that esm.sh recognizes this as an existing thing. But if you want to still use NPM in a NodeJS capable environment for this framework because your used to using it already, go ahead.
Adapters
- GitHub (webhooks, REST API)
- Discord (coming soon)
Examples of usage:
Github adapter:
import {
BootBot,
GitHubAdapter,
autoHandler
} from "https://esm.sh/@monitio/boot";
const bot = new BootBot();
bot.use(GitHubAdapter({ secret: "..." }));
bot.on("github:push", (payload) => {
console.log("Push event:", payload);
});
// Export the right handler depending on environment
export default autoHandler(bot);Testing
To test we are using NodeJS and Vitest but in actual scenarios you do not actually need NodeJS or Vitest to run.
There is a Github Actions called CI that runs every single time a commit is pushed to Github, or a pull request is made that tests for you. So no need to check your code first if you are contributing but it would be helpful if you did.
To test you run the command:
npm test
And that will run Vitest which will run all of the tests.
8 months ago