notes.js 910 B

12345678910111213141516171819202122232425262728
  1. const stripAnsi = require('strip-ansi')
  2. const iPhoneBackup = require('../util/iphone_backup.js').iPhoneBackup
  3. const normalizeCols = require('../util/normalize.js')
  4. module.exports.name = 'notes'
  5. module.exports.description = 'List all iOS notes'
  6. module.exports.requiresBackup = true
  7. module.exports.functions = {
  8. '>=9.0' : function (program, backup) {
  9. backup.getNotes(program.dump)
  10. .then((items) => {
  11. // Format the output
  12. program.formatter.format(items, {
  13. color: program.color,
  14. columns: {
  15. 'Modified': el => (el.XFORMATTEDDATESTRING || el.XFORMATTEDDATESTRING1) + '',
  16. 'ID': el => el.Z_PK,
  17. 'Title2': el => (el.ZTITLE2 + '').trim().substring(0, 128),
  18. 'Title1': el => (el.ZTITLE1 + '').trim() || ''
  19. }
  20. })
  21. })
  22. .catch((e) => {
  23. console.log('[!] Encountered an Error:', e)
  24. })
  25. }
  26. }