Skip to content

Latest commit

 

History

History
81 lines (60 loc) · 2.08 KB

node.md

File metadata and controls

81 lines (60 loc) · 2.08 KB

Node.js

Classes

ImageData

ImageData polyfill for Node.js

Functions

get(data, callback)

Asynchronously get an ImageData instance based on provided data

getSync(data)ImageData

Synchronously get an ImageData instance based on provided data

ImageData

ImageData polyfill for Node.js

new ImageData(object)

Create a new ImageData instance from an object literal

Throws:

  • Error If the object argument is not an object literal
  • Error If the object argument is missing required property data
  • Error If the object argument is missing required property width
  • Error If the object argument is missing required property height
Param Type
object Object

get(data, callback)

Asynchronously get an ImageData instance based on provided data

Throws:

  • Error If the data argument is not a string, Buffer, or ReadStream
  • Error If the callback argument is not a function
Param Type
data string | Buffer | ReadStream
callback function

getSync(data) ⇒ ImageData

Synchronously get an ImageData instance based on provided data

Throws:

  • Error If the data argument is not a string or Buffer
  • Error If the data argument is a string and the file could not be found
  • Error If the mime type could not be retrieved
  • Error If no image decoder could be found for the mime type
Param Type
data string | Buffer