is-iso

0.2.0 • Public • Published

is-iso Build Status codecov

Check if a Buffer/Uint8Array is an ISO image.

Install

$ npm install is-iso

Usage

Node.js

var readChunk = require('read-chunk'); // npm install read-chunk
var isIso = require('is-iso');
var buffer = readChunk.sync('unicorn.iso', 0, 36870);
 
isIso(buffer);
//=> true

Browser

var xhr = new XMLHttpRequest();
xhr.open('GET', 'unicorn.iso');
xhr.responseType = 'arraybuffer';
 
xhr.onload = function () {
    isIso(new Uint8Array(this.response));
    //=> true
};
 
xhr.send();

API

isIso(buffer)

Accepts a Buffer (Node.js) or Uint8Array.

It only needs the first 36870 bytes.

License

MIT © undisk

Package Sidebar

Install

npm i is-iso

Weekly Downloads

0

Version

0.2.0

License

MIT

Last publish

Collaborators

  • t1st3