# @shelf/aws-lambda-brotli-unpacker

> Unpacks large Lambda binaries to /tmp

Latest version **2.1.0** (published 2022-07-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @shelf/aws-lambda-brotli-unpacker
pnpm add @shelf/aws-lambda-brotli-unpacker
yarn add @shelf/aws-lambda-brotli-unpacker
bun add @shelf/aws-lambda-brotli-unpacker
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2022-07-20 |
| First published | 2018-11-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=16 |
| Dependencies | 1 |
| Unpacked size | 7.4 KB |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Vlad Holubiev |
| Maintainers | anastasiash, kchlon, dmytro.harazdovskiy, duch0416, i5adovyi, olesiamuller, mykola.khytra, yuliiakovalchuk, el_scrambone, bodyaflesh, slavammellnikov, andrii-nastenko, andriisermiahin, arkadii007, mpushkin, batovpavlo, vasylhoban, andrew214, domovoj, vozemer, oleksii.dymnich, set001, dima-bond, maksym.hayovets, oles.zadorozhnyy, ss1l, gemshelf, d-mii-, hartzler, tarasdyksan, andrii_butsa, nazarko_suv, bogdan.kolesnyk, vitaliishcherban, vladgolubev, marianna-milovanova, hmelenok, knupman, maaraanas, terret, chapelskyi.slavik, pihorb, irynah, diana.kryskuv, andy.raven, rafler, mykola.chepkyi, sskalp88, demiansua, yuriil, ktv18, drews_abuse, rostyslav-horytskyi, whodeen |
| Keywords | lambda, brotli |

## Links

- npm: https://www.npmjs.com/package/@shelf/aws-lambda-brotli-unpacker
- Repository: https://github.com/shelfio/aws-lambda-brotli-unpacker
- npm.io page: https://npm.io/package/@shelf/aws-lambda-brotli-unpacker

## Dependencies (1)

- [tar-fs](https://npm.io/package/tar-fs.md) 2.1.1

## Recent versions

- 2.1.0 (latest) — 2022-07-20
- 2.0.0 — 2022-02-22
- 1.0.1 — 2022-02-22
- 1.0.0 — 2019-12-26
- 0.0.2 — 2018-11-03
- 0.0.1 — 2018-11-03

## README

# aws-lambda-brotli-unpacker [![CircleCI](https://circleci.com/gh/shelfio/aws-lambda-brotli-unpacker/tree/master.svg?style=svg&circle-token=a31c3d7699a00ad54a4a8c3fce9e8636973c81f3)](https://circleci.com/gh/shelfio/aws-lambda-brotli-unpacker/tree/master) ![](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)

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

Inspired by [chrome-aws-lambda](https://github.com/alixaxel/chrome-aws-lambda)

Used in projects: [aws-lambda-tesseract](https://github.com/shelfio/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](https://docs.aws.amazon.com/lambda/latest/dg/running-lambda-code.html) in `/tmp`

> Q: Why brotli?

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

## Example

```js
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

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

## License

MIT © [Shelf](https://shelf.io)

---
_Source: https://npm.io/package/@shelf/aws-lambda-brotli-unpacker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
