Instance Methods
getStream
(async) getStream(): Promise.<NodeJS.ReadableStream>Returns a stream containing the image data.
Returns
A nodejs stream containing the image data. The readable stream contains metadata properties (Image.ImageStreamMetadata)
pipe
(async) pipe(stream): Promise.<Image.ImageStreamMetadata>Pipe the image into the target stream and returns metadata.
Parameters
Name | Type | Description |
---|---|---|
stream
|
NodeJS.WritableStream |
Returns
Stream metadata
setPath
setPath(path)Set the image's path
Parameters
Name | Type | Description |
---|---|---|
path
|
string | Relative path to your image, e.g. |
setStream
setStream(source)Set the image's data.
Parameters
Name | Type | Description |
---|---|---|
source
|
function | This function will be called with the parameter |
setUrl
setUrl(url)Set the image's URL. This URL must be accessible from any network.
Parameters
Name | Type | Description |
---|---|---|
url
|
string | Absolute url, |
unregister
(async) unregister()Unregister the image. This is a shorthand method for ManagerImages#unregisterImage.
update
(async) update(): Promise.<any>Notify that the image's contents have changed
Returns
Type Definitions
ImageStreamMetadata
ImageStreamMetadataProperties
Name | Type | Description |
---|---|---|
filename
|
string | A filename for this image |
contentType
|
string | The mime type of this image |
contentLength
|
number <optional> | The size in bytes, if available |