# is-woff

> Check if a Buffer/Uint8Array is WOFF

Latest version **1.0.3** (published 2016-02-29) · MIT license · 0 weekly downloads

## Install

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

## 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 | 1.0.3 |
| Published | 2016-02-29 |
| First published | 2015-02-04 |
| 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 | junmer |
| Maintainers | junmer |
| Keywords | font, font-face, sfnt, woff, type, detect, check, is, binary, buffer, uint8array |

## Links

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

## 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.3 (latest) — 2016-02-29
- 1.0.2 — 2016-02-29
- 1.0.1 — 2015-02-04

## README

# is-woff [![Build Status](https://travis-ci.org/junmer/is-woff.svg?branch=master)](https://travis-ci.org/junmer/is-woff)

> Check if a Buffer/Uint8Array is a [WOFF](http://www.w3.org/TR/WOFF/#WOFFHeader) 

## Install

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


## Usage

##### Node.js

```js
var readChunk = require('read-chunk'); // npm install read-chunk
var isWoff = require('is-woff');
var buffer = readChunk.sync('font.woff', 0, 8);

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

##### Browser

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

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

xhr.send();
```


## API

### isWoff(buffer)

Accepts a Buffer (Node.js) or Uint8Array.

It only needs the first 8 bytes.

## Test

```sh
$ npm test
```

> test file from [Font-Awesome](https://github.com/FortAwesome/Font-Awesome)

## License

MIT © [junmer](https://github.com/junmer/)

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