@shelf/aws-lambda-brotli-unpacker

2.1.0 • Public • Published

aws-lambda-brotli-unpacker CircleCI

Unpacks large Lambda binaries to /tmp, such as Tesseract, LibreOffice, Google Chrome, etc

Inspired by chrome-aws-lambda

Used in projects: aws-lambda-tesseract

Install

$ yarn add @shelf/aws-lambda-brotli-unpacker

Version 1.x works with Node 10.x & 12.x only. For Node 8.10 use v0.0.2

Test

Needs Docker installed.

$ npm test

Usage

Q: Why do I need this package?

A: It helps if you want to deploy pre-compiled software to use in Lambda. See list of projects where it is used above.

Q: Why bother?

A: Lambda environment has limited software installed. This package helps ship large binaries compiled for Lambda which unpack to /tmp folder when Lambda starts.

Q: Why /tmp?

A: Lambda has 500 MB of storage in /tmp

Q: Why brotli?

A: This compression algorithm is known for great speed/size ration. Perfect for scarce Lambda resources.

Example

const {unpack} = require('@shelf/aws-lambda-brotli-unpacker');
const {execSync} = require('child_process');

const inputPath = path.join(__dirname, '..', 'bin', 'tt.tar.br'); // for example, tesseract
const outputPath = '/tmp/tesseract/tesseract';

module.exports.handler = async event => {
  await unpack({inputPath, outputPath});

  execSync(`${outputPath} -l eng image.png`);
};

Publish

$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags

License

MIT © Shelf

Readme

Keywords

Package Sidebar

Install

npm i @shelf/aws-lambda-brotli-unpacker

Weekly Downloads

199

Version

2.1.0

License

MIT

Unpacked Size

7.61 kB

Total Files

10

Last publish

Collaborators

  • vladmarchuk
  • vadymaslovskyi
  • marianna-milovanova
  • petro.bodnarchuk
  • kateryna-kochina
  • maksym.tarnavskyi
  • andrii-nastenko
  • mykhailo.yatsko
  • ahavrysh
  • nikita_shelf
  • maciej.orlowski
  • monopotan
  • andrew214
  • bogdan.kolesnyk
  • kristina.zhak
  • anton-russo
  • mmazurowski
  • mateuszgajdashelf
  • kchlon
  • dmytro.harazdovskiy
  • duch0416
  • i5adovyi
  • olesiamuller
  • mykola.khytra
  • yuliiakovalchuk
  • el_scrambone
  • bodyaflesh
  • andriisermiahin
  • mpushkin
  • batovpavlo
  • domovoj
  • oleksii.dymnich
  • dima-bond
  • maksym.hayovets
  • oles.zadorozhnyy
  • ss1l
  • gemshelf
  • hartzler
  • vladgolubev
  • hmelenok
  • knupman
  • maaraanas
  • terret
  • chapelskyi.slavik
  • pihorb
  • irynah
  • diana.kryskuv
  • andy.raven
  • rafler
  • sskalp88
  • demiansua
  • yuriil
  • ktv18
  • drews_abuse
  • rostyslav-horytskyi
  • whodeen