# is-7z

> Check if a Buffer/Uint8Array is a 7Z archive

Latest version **2.0.0** (published 2018-05-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-7z
pnpm add is-7z
yarn add is-7z
bun add is-7z
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2018-05-06 |
| First published | 2016-01-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 0 |
| Unpacked size | 2.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | t1st3 |
| Maintainers | t1st3 |
| Keywords | 7z, 7-zip, archive, type, detect, check, is, binary, buffer, uint8array |

## Links

- npm: https://www.npmjs.com/package/is-7z
- Repository: https://github.com/t1st3/is-7z
- Homepage: https://github.com/t1st3/is-7z#readme
- Issues: https://github.com/t1st3/is-7z/issues
- npm.io page: https://npm.io/package/is-7z

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2018-05-06
- 1.0.0 — 2017-04-11
- 0.1.0 — 2016-01-19

## README

# is-7z

[![NPM version](https://img.shields.io/npm/v/is-7z.svg)](https://www.npmjs.com/package/is-7z)
[![Build Status](https://travis-ci.org/t1st3/is-7z.svg?branch=master)](https://travis-ci.org/t1st3/is-7z)

> Check if a Buffer/Uint8Array is a [7Z](https://en.wikipedia.org/wiki/7z) archive.


## Install

```sh
$ npm install --save is-7z
```


## Usage

### Node.js

```js
var readChunk = require('read-chunk'); // npm install read-chunk
var is7z = require('is-7z');
var buffer = readChunk.sync('unicorn.7z', 0, 6);

is7z(buffer);
//=> true
```

### Browser

```js
var xhr = new XMLHttpRequest();
xhr.open('GET', 'unicorn.7z');
xhr.responseType = 'arraybuffer';

xhr.onload = function () {
	is7z(new Uint8Array(this.response));
	//=> true
};

xhr.send();
```


## API

### is7z(buffer)

Accepts a Buffer (Node.js) or Uint8Array.

It only needs the first 6 bytes.


## License

MIT © [t1st3](https://t1st3.com)

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