UNPKG

enex-dump

Version:

Dump the content of .enex files, preserving attachments, some metadata and optionally converting notes to Markdown.

28 lines (15 loc) 658 B
/* IMPORT */ const _ = require ( 'lodash' ), Config = require ( './config' ), Dump = require ( './dump' ), Utils = require ( './utils' ); /* ENEX DUMP */ function EnexDump ( options ) { _.merge ( Config, options ); if ( !Config.path.src.length ) Utils.throw ( 'You have to pass at least one src path' ); if ( !Config.path.dst ) Utils.throw ( 'You have to pass a dst path' ); if ( !Config.dump.formats.includes ( Config.dump.format ) ) Utils.throw ( `We only support these formats: ${Config.dump.formats.map ( format => `"${format}"` ).join ( ', ' )} ` ); return Dump.enex (); } /* EXPORT */ module.exports = EnexDump;