# is-heic

> Check if a Buffer/Uint8Array is a HEIC image

Latest version **1.0.0** (published 2018-01-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-heic
pnpm add is-heic
yarn add is-heic
bun add is-heic
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-01-11 |
| First published | 2018-01-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Oleh Aleinyk |
| Maintainers | oaleynik |
| Keywords | binary, buffer, check, detect, exif, heic, image, img, is, photo, pic, picture, type, uint8array |

## Links

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

## 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

- 1.0.0 (latest) — 2018-01-11

## README

# is-heic

> Check if a Buffer/Uint8Array is a HEIC image (inspired by [is-jpg](https://github.com/sindresorhus/is-jpg))


## Install

```sh
$ npm install --save is-heic
```


## Usage

##### Node.js

```js
var readChunk = require('read-chunk'); // npm install read-chunk
var isHeic = require('is-heic');
var buffer = readChunk.sync('unicorn.heic', 0, 24);

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

##### Browser

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

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

xhr.send();
```


## API

### isHeic(buffer)

Accepts a Buffer (Node.js) or Uint8Array.

It only needs the first 24 bytes.


## License

MIT © [Oleh Aleinyk](https://github.com/oaleynik)

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