Constructor
# new Asset(uri, optsnullable)
`Asset` class constructor.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
uri |
String | ||||||||||||||||||||||
opts |
Object |
<nullable> |
Properties
|
Extends
- nanoresource
Methods
# (protected) _open(callback)
Implements the abstract `_open()` method for `nanoresource`
Opens the asset source stream and initializes internal state.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |
# createReadStream(optsnullable) → {Stream}
Creates a read stream for the asset URI.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
opts |
Object |
<nullable> |
Returns:
- Type
- Stream
# ready(callback)
Wait for asset to be ready (opened) calling `callback()`
when it is.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |