-
Notifications
You must be signed in to change notification settings - Fork 53
Plugins
Rich Infante edited this page Apr 24, 2018
·
1 revision
As of version 4.0, there is now a plugin api which allows custom reports to be loaded from the disk. The format of a custom plugin typically looks like this:
const { Group } = require('ibackuptool')
// Exported report modules
module.exports = {
example: new Group({
test: require('./test.js') // test.js is a v3 or v4 report module.
})
}We can then run the report using:
const bt = require('ibackuptool')
bt.run('example.test')
.then(console.log)
.catch(console.log)There are a couple notes about these plugins:
- Currently, you cannot utilize any of the top-level groups provided by default. For example, you cannot define a
safari.foobarreport inside of a plugin, since thesafarigroup already exists. - In order to create a group, you must use the
Groupclass which is exported from theibackuptoolmodule.