/doc2html

Node app for converting .docx Word files to clean html

Primary LanguageHTML

doc2html

This is a simple command-line Node app to convert Word .docx files to HTML files. You can convert a single Word file using the convert command or convert a folder of Word files by using the convertdir command.

Installation

Download repo to your local machine and run npm install

npm install

Convert Single Word File

Convert a single Word file using the convert command by passing the path the file name --from or -f and specifying the output path/file name --to or -t.

node app.js convert --from './word/med.docx' --to './word/med.html'

or 

node app.js convert -f './word/med.docx' -t './word/med.html'

(Note: the sample document in the example above is included in repo /word/med.docx)

Convert All Word Files Within a Folder

Convert all the Word files in a given directory by using the convertdir command and passing the path to the folder --folder or -d. The converted files will be in a directory named with the same name provided and nested in an /output folder.

node app.js convertdir --folder './wordfolder'

or

node app.js convertdir -d './wordfolder'

(Note: the sample folder in the example above is included in repo /wordfolder)