forked from gautamdhameja/medium-2-md
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
executable file
·26 lines (22 loc) · 965 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env node
'use strict';
const program = require('commander');
const workflow = require('./lib/workflow');
const packageJson = require('./package.json');
program
.version(packageJson.version)
.command('convertLocal [inputDirectory]')
.description('Converts Medium exported html files to markdown from a local directory.')
.option('-d, --drafts', 'Convert drafts too.')
.option('-f, --frontMatter', 'Add front-matter.')
.option('-i, --images', 'Download images in local directory.')
.action(workflow.processAll);
program
.version(packageJson.version)
.command('convertUrl [url]')
.description('Converts Medium post to markdown from its url.')
.option('-o, --outputDir <>', 'Output directory path.')
.option('-f, --frontMatter', 'Add front-matter.')
.option('-i, --images', 'Download images in local directory.')
.action(workflow.processSingle);
program.parse(process.argv);