_example.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Name of the module.
  2. module.exports.name = 'example module'
  3. // Description of the module
  4. module.exports.description = 'An example module to show how it works'
  5. // Specify this reporter requires a backup.
  6. // The second parameter to func() is now a backup instead of the path to one.
  7. module.exports.requiresBackup = true
  8. // Should this report be skipped in automated reports?
  9. // This is used when the 'all' report type is specified, and all possible reports are generated.
  10. // with this set to true, the report WILL NOT run when report type = 'all'
  11. module.exports.requiresInteractivity = true
  12. // Specify this reporter supports the promises API for allowing chaining of reports.
  13. module.exports.usesPromises = true
  14. // Specify this only works for iOS 10+
  15. module.exports.supportedVersions = '>=10.0'
  16. // Reporting function (for usesPromises = false)
  17. module.exports.func = function (program, backup) {
  18. // This function will be called with the `commander` program, and the iPhoneBackup instance as arguments
  19. // This is deprecated.
  20. }
  21. // Reporting function (for usesPromises = true)
  22. module.exports.func = function (program, backup, resolve, reject) {
  23. // This function will be called with the `commander` program, and the iPhoneBackup instance as arguments
  24. // It MUST resolve() the final result, or reject() if there's an error
  25. }
  26. // --- OR ---
  27. // You can also provide an array of functions instead of using `module.exports.func`.
  28. // These functions *should* be independent ranges to ensure reliable execution
  29. module.exports.functions = {
  30. '>=10.0': function(program,backup) {
  31. // This function would be called for iOS 10+
  32. },
  33. '>=9.0,<10.0': function(program,backup) {
  34. // This function would be called for all iOS 9.
  35. }
  36. }