file2html
JS convertor of files to HTML and CSS code
Requirements
Supported formats
- Text file2html-text (.txt)
- Images file2html-image (.png, .jpg, .gif, .svg, .ico, .wbmp)
- OOXML Documents file2html-ooxml (.docx)
- OOXML Presentations (.pptx)
- OOXML Spreadsheets (.xlsx)
- ODF Text Files file2html-odf (.odt)
- DSV file2html-dsv (.csv, .tsv)
- FictionBook file2html-fiction-book (.fb2)
- EPUB file2html-epub (.epub)
- DjVu (.djvu, .djv)
- RTF (.rtf)
- WCBFF (.doc)
Usage
Installation
> npm i file2html
Installation of required engines for each file type:
> npm i file2html-text file2html-ooxml file2html-image
Check supported formats to decide which engines you need.
Configuration
;;;; file2html;
File reading
file2html;
FileMetaInformation
fileType: number; // optional mimeType: string; // optional name: string; // optional size: number; // optional creator: string; // optional createdAt: string; // optional modifiedAt: string; // optional
File
{ // returns object of file2html.FileMetaInformation } { // returns object of file2html.FileData }
FileData
meta: file2htmlFileMetaInformation; styles: string; // css styles as a string content: string; // html markup as a string
Showcase
StormFiles
Browser extension, file viewer: