Socket
Book a DemoInstallSign in
Socket

@shelf/aws-lambda-libreoffice

Package Overview
Dependencies
Maintainers
2
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shelf/aws-lambda-libreoffice

85 MB LibreOffice to fit inside AWS Lambda compressed with Brotli

Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
8.1K
9.52%
Maintainers
2
Weekly downloads
 
Created
Source

aws-lambda-libreoffice

85 MB LibreOffice to fit inside AWS Lambda compressed with Brotli

Inspired by chrome-aws-lambda

✨ Also works in Google Cloud Functions as long as you select Node.js 8 runtime (thanks to ncruces for the info)

Install

$ yarn add @shelf/aws-lambda-libreoffice

Usage

const {convertFileToPDF} = require('@shelf/aws-lambda-libreoffice');

module.exports.handler = async () => {
  // assuming there is a document.docx file inside /tmp dir
  // original file will be deleted afterwards

  return convertFileToPDF('/tmp/document.docx'); // will create /tmp/document.pdf
};

Or if you want more control:

const {getExecutablePath, defaultArgs} = require('@shelf/aws-lambda-libreoffice');

const loBinary = await getExecutablePath(); // /tmp/instdir/program/soffice

execSync(`${loBinary} ${defaultArgs.join(' ')} --convert-to pdf file.docx --outdir /tmp`);

See Also

License

MIT © Shelf

FAQs

Package last updated on 03 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts