
Research
/Security News
npm Author Qix Compromised via Phishing Email in Major Supply Chain Attack
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
@shelf/aws-lambda-libreoffice
Advanced tools
Utility to work with Docker version of LibreOffice in Lambda
Utility to work with Docker version of LibreOffice in Lambda
$ pnpm add @shelf/aws-lambda-libreoffice
First, you need to create a Docker image for your Lambda function. See the example at libreoffice-lambda-base-image repo.
Example:
FROM public.ecr.aws/shelf/lambda-libreoffice-base:7.6-node20-x86_64
COPY ./ ${LAMBDA_TASK_ROOT}/
RUN pnpm install
CMD [ "handler.handler" ]
ephemeral-storage
parameterHOME
to /tmp
This package is now a native ESM module. If you're using CommonJS, you'll need to use dynamic imports or update your project to use ESM.
import {convertTo, canBeConvertedToPDF} from '@shelf/aws-lambda-libreoffice';
export const handler = async () => {
// assuming there is a document.docx file inside /tmp dir
// original file will be deleted afterwards
// it is optional to invoke this function, you can skip it if you're sure about file format
if (!canBeConvertedToPDF('document.docx')) {
return false;
}
return convertTo('document.docx', 'pdf'); // returns /tmp/document.pdf
};
module.exports.handler = async () => {
const {convertTo, canBeConvertedToPDF} = await import('@shelf/aws-lambda-libreoffice');
if (!canBeConvertedToPDF('document.docx')) {
return false;
}
return convertTo('document.docx', 'pdf'); // returns /tmp/document.pdf
};
Beside unit tests that could be run via pnpm test
, there are integration tests.
# Unit tests
pnpm test
# Integration test with Docker/Podman
cd test
./test.sh
# The test will:
# 1. Build the ESM code and transpile to CommonJS for Lambda compatibility
# 2. Process all files in test-data/ directory
# 3. Generate PDFs in the same test-data/ directory
# 4. Show conversion summary
The test setup includes:
test/test-data/
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
MIT © Shelf
FAQs
Utility to work with Docker version of LibreOffice in Lambda
The npm package @shelf/aws-lambda-libreoffice receives a total of 7,675 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 57 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.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.