JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 185768
  • Score
    100M100P100Q175054F

Check if a Buffer/Uint8Array is available for cwebp image source

Package Exports

  • is-cwebp-readable

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (is-cwebp-readable) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

is-cwebp-readable

NPM version Build Status Build status Coverage Status Dependency Status devDependency Status

Check if a Buffer/Uint8Array is available for cwebp image source

var fs = require('fs');
var isCwebpReadable = require('is-cwebp-readable');

isCwebpReadable(fs.readFileSync('fixture.png')); //=> true
isCwebpReadable(fs.readFileSync('fixture.bmp')); //=> false

Installation

Use npm.

npm install is-cwebp-readable

API

var isCwebpReadable = require('is-cwebp-readable');

isCwebpReadable(buf)

buf: Buffer or Uint8Array
Return: Boolean

It returns true if the data is PNG, JPEG, TIFF, or WebP, otherwise false.

License

Copyright (c) Shinnosuke Watanabe

Licensed under the MIT License.