UNPKG

epubinator

Version:

NPM package to generate epub files out of url

44 lines (43 loc) 1.08 kB
#!/usr/bin/env node "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var main_1 = require("../main"); var getopts = require("getopts"); var announcer_1 = require("../announcer"); var options = getopts(process.argv.slice(2), { alias: { multiurl: 'm', title: 't', path: 'p', version: 'v', author: 'a', help: 'h', }, default: { multiurl: false, path: './', author: '', }, }); if (options.help) { (0, announcer_1.printUsage)(); process.exit(0); } var website = options['_'][0]; var multiurl = options.multiurl, title = options.title, path = options.path, version = options.version, author = options.author; if (version) { (0, announcer_1.showVersion)(); } else { if (!website) { console.log('missing url \n'); (0, announcer_1.printUsage)(); process.exit(0); } (0, main_1.main)(website, { multiurl: multiurl, title: title || website, path: path || process.cwd(), author: author, }); }