# @tomjs/unzip-crx

> unzip chrome extension files (*.crx)

Latest version **1.1.3** (published 2024-07-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @tomjs/unzip-crx
pnpm add @tomjs/unzip-crx
yarn add @tomjs/unzip-crx
bun add @tomjs/unzip-crx
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2024-07-12 |
| First published | 2023-11-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=14 |
| Dependencies | 1 |
| Unpacked size | 12.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Tom Gao |
| Maintainers | tomgao365 |
| Keywords | unzip, crx, chrome, extension, manifest |

## Links

- npm: https://www.npmjs.com/package/@tomjs/unzip-crx
- Repository: https://github.com/tomjs/unzip-crx
- Homepage: https://github.com/tomjs/unzip-crx#readme
- Issues: https://github.com/tomjs/unzip-crx/issues
- npm.io page: https://npm.io/package/@tomjs/unzip-crx

## Dependencies (1)

- [jszip](https://npm.io/package/jszip.md) ^3.10.1

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 1.1.3 (latest) — 2024-07-12
- 1.1.2 — 2024-07-01
- 1.1.1 — 2024-07-01
- 1.1.0 — 2023-12-21
- 1.0.6 — 2023-12-16
- 1.0.5 — 2023-12-16
- 1.0.4 — 2023-12-16
- 1.0.3 — 2023-12-08
- 1.0.2 — 2023-12-08
- 1.0.1 — 2023-11-29
- 1.0.0 — 2023-11-29

## README

# @tomjs/unzip-crx

[![npm](https://img.shields.io/npm/v/@tomjs/unzip-crx)](https://www.npmjs.com/package/@tomjs/unzip-crx) ![node-current (scoped)](https://img.shields.io/node/v/@tomjs/unzip-crx) ![NPM](https://img.shields.io/npm/l/@tomjs/unzip-crx) [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@tomjs/unzip-crx)

**English** | [中文](./README.zh_CN.md)

> Unzip chrome extension files

If you want to unzip [Chrome extension files](https://developer.chrome.com/extensions) (\*.crx) you might have the problem that your unzip lib claims that the file header is malformed. This is due to that Chrome [adds some extra information](https://developer.chrome.com/extensions/crx) for identifying crx files. `unzip-crx` handles those additional headers and unzips as usual.

This library is based on [Peerigon](https://github.com/peerigon)'s [unzip-crx](https://github.com/peerigon/unzip-crx), which makes simple modifications and adds `esm` and `cjs` support.

And this [unzip-crx](https://github.com/peerigon/unzip-crx) is highly inspired by [crx2ff](https://github.com/abarreir/crx2ff) from [abarreir](https://github.com/abarreir) and [crxviewer](https://github.com/Rob--W/crxviewer) from [Rob Wu](https://github.com/Rob--W), thanks!

## Install

```bash
# pnpm
pnpm add @tomjs/unzip-crx

# yarn
yarn add @tomjs/unzip-crx

# npm
npm add @tomjs/unzip-crx
```

## Example

- `esm`

```js
import unzip from 'unzip-crx';

const crxFile = './this-chrome-extension.crx';

unzip(crxFile).then(() => {
  console.log('Successfully unzipped your crx file..');
});
```

- `cjs`

```js
const unzip = require('unzip-crx');

const crxFile = './this-chrome-extension.crx';

unzip(crxFile).then(() => {
  console.log('Successfully unzipped your crx file..');
});
```

## Documentation

- [API Document](https://www.jsdocs.io/package/@tomjs/unzip-crx) provided by [jsdocs.io](https://www.jsdocs.io).
- [index.d.ts](https://www.unpkg.com/browse/@tomjs/unzip-crx/dist/index.d.ts) provided by [unpkg.com](https://www.unpkg.com).

## API

### unzip(file[, destination])

- `file`: string, the path to the file to unzip
- `destination`: string, the path to the destination folder (optional)

Resolves with a Promise if the file was unzipped successfully, throws otherwise (use `.catch()`).

---
_Source: https://npm.io/package/@tomjs/unzip-crx · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
