Socket
Socket
Sign inDemoInstall

is-cwebp-readable

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-cwebp-readable

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


Version published
Weekly downloads
157K
decreased by-29.45%
Maintainers
1
Weekly downloads
 
Created
Source

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

const fs = require('fs');
const 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

const 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

Creative Commons Zero v1.0 Universal

Keywords

FAQs

Package last updated on 08 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc