Methods
(async) getStream() → {Promise.<NodeJS.ReadableStream>}
Returns a stream containing the image data.
- Since:
- 2.2.0
Returns:
- Type:
-
Promise.<NodeJS.ReadableStream>
A nodejs stream containing the image data. The readable stream contains metadata properties (Image.ImageStreamMetadata)
(async) pipe(stream) → {Promise.<Image.ImageStreamMetadata>}
Pipe the image into the target stream and returns metadata.
- Since:
- 2.2.0
Parameters:
Name | Type | Description |
---|---|---|
stream |
NodeJS.WritableStream
|
setPath(path)
Set the image's path
Parameters:
Name | Type | Description |
---|---|---|
path |
String
|
Relative path to your image, e.g. |
setStream(source)
Set the image's data.
- Since:
- 2.2.0
- Library:
Parameters:
Name | Type | Description |
---|---|---|
source |
function
|
This function will be called with the parameter |
setUrl(url)
Set the image's URL. This URL must be accessible from any network.
Parameters:
Name | Type | Description |
---|---|---|
url |
String
|
Absolute url, |
(async) unregister()
Unregister the image. This is a shorthand method for ManagerImages#unregisterImage.
(async) update() → {Promise.<any>}
Notify that the image's contents have changed
Returns:
- Type:
-
Promise.<any>
Type Definitions
ImageStreamMetadata
Properties:
Name | Type | Attributes | 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 |