Skip to content

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)

Notes

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.foobar report inside of a plugin, since the safari group already exists.
  • In order to create a group, you must use the Group class which is exported from the ibackuptool module.

Clone this wiki locally