
Security News
Open VSX Begins Implementing Pre-Publish Security Checks After Repeated Supply Chain Incidents
Following multiple malicious extension incidents, Open VSX outlines new safeguards designed to catch risky uploads earlier.
@shelf/aws-lambda-libreoffice
Advanced tools
92 MB LibreOffice to fit inside AWS Lambda compressed with Brotli
Helper package to work with LibreOffice in AWS Lambda
$ yarn add @shelf/aws-lambda-libreoffice
This version requires Node 16.x or higher.
First, you need to create a Docker image for your Lambda function. See the example at libreoffice-lambda-base-image repo.
Given you have packaged your Lambda function as a Docker image, you can now use this package:
const {convertTo, canBeConvertedToPDF} = 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
if (!canBeConvertedToPDF('document.docx')) {
return false;
}
return convertTo('document.docx', 'pdf'); // returns /tmp/document.pdf
};
This version requires Node 12.x or higher.
NOTE: Since version 2.0.0 npm package no longer ships the 85 MB LibreOffice but relies upon libreoffice-lambda-layer instead. Follow the instructions on how to add a lambda layer in that repo.
const {convertTo, canBeConvertedToPDF} = 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
if (!canBeConvertedToPDF('document.docx')) {
return false;
}
return convertTo('document.docx', 'pdf'); // returns /tmp/document.pdf
};
Or if you want more control:
const {unpack, defaultArgs} = require('@shelf/aws-lambda-libreoffice');
await unpack(); // default path /tmp/instdir/program/soffice.bin
execSync(
`/tmp/instdir/program/soffice.bin ${defaultArgs.join(
' '
)} --convert-to pdf file.docx --outdir /tmp`
);
lambci/lambda:nodejs12.x imageBeside unit tests that could be run via yarn test, there are integration tests.
Smoke test that it works: ./test/test.sh.
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master
MIT © Shelf
FAQs
Utility to work with Docker version of LibreOffice in Lambda
The npm package @shelf/aws-lambda-libreoffice receives a total of 9,072 weekly downloads. As such, @shelf/aws-lambda-libreoffice popularity was classified as popular.
We found that @shelf/aws-lambda-libreoffice demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 58 open source maintainers collaborating on the project.
Did you know?

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.

Security News
Following multiple malicious extension incidents, Open VSX outlines new safeguards designed to catch risky uploads earlier.

Research
/Security News
Threat actors compromised four oorzc Open VSX extensions with more than 22,000 downloads, pushing malicious versions that install a staged loader, evade Russian-locale systems, pull C2 from Solana memos, and steal macOS credentials and wallets.

Security News
Lodash 4.17.23 marks a security reset, with maintainers rebuilding governance and infrastructure to support long-term, sustainable maintenance.