is-eot

1.0.0 • Public • Published

is-eot Build Status

Check if a Buffer/Uint8Array is a EOT

Install

$ npm install --save is-eot

Usage

Node.js
var readChunk = require('read-chunk'); // npm install read-chunk
var isEot = require('is-eot');
var buffer = readChunk.sync('font.eot', 0, 36);
 
isEot(buffer);
//=> true
Browser
var xhr = new XMLHttpRequest();
xhr.open('GET', 'font.eot');
xhr.responseType = 'arraybuffer';
 
xhr.onload = function () {
    isEot(new Uint8Array(this.response));
    //=> true
};
 
xhr.send();

API

isEot(buffer)

Accepts a Buffer (Node.js) or Uint8Array.

Test

$ npm test

test file from Font-Awesome

License

MIT © junmer

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.03,763latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.03,763

Package Sidebar

Install

npm i is-eot

Weekly Downloads

3,763

Version

1.0.0

License

MIT

Last publish

Collaborators

  • junmer