convert-file-type

2.0.0 • Public • Published

convert-file-type

A simple and fast node.js module for converting office documents to different formats.

Dependency

Please install libreoffice in /Applications (Mac), with your favorite package manager (Linux), or with the msi (Windows).

Usage example

'use strict';

import {convert} from 'convert-file-type'
try{
    const outputPath= await convert.toPdf(pathOfInputFile,outputFileName)
    console.log(outputPath)
}
catch(err){
    console.log(err)
}

Properties

  • pathOfInputFile The complete path of input file with file name like /home/abc/test.docx
  • outputFileName The output file name without extension like test

Warning

Output file will always be overwritten if file already exists with same name.

Example: outputFileName can be combination of userId and datetimestamp

Readme

Keywords

none

Package Sidebar

Install

npm i convert-file-type

Weekly Downloads

1

Version

2.0.0

License

ISC

Unpacked Size

2.9 kB

Total Files

4

Last publish

Collaborators

  • sonicadhoot