Skip to main content

Plugins

You can add tags, CLI commands, and listeners by creating a JS file or node project that implements the register() function:

// myPlugin.js
exports.register = (bluehawk) => {
// Register a new tag, :my-tag:
bluehawk.registerTag("my-tag", {
rules: [],
process: (request) => {
// Execute tag
},
});

// Register a document listener
bluehawk.subscribe((finishedDocument) => {
// Do something with finishedDocument
});
};

Usage:

bluehawk --plugin ./myPlugin source.txt

You can pass the --plugin flag multiple times to load different plugins or create a plugin that is composed of other plugins.