Asset

Asset

The `Asset` class represents a container for an external asset that has semantic associations with other objects.

Constructor

# new Asset(uri, optsnullable)

`Asset` class constructor.
Parameters:
Name Type Attributes Description
uri String
opts Object <nullable>
Properties
Name Type Attributes Description
id String <nullable>
cwd String <nullable>
type String <nullable>
associations Array.<String> <nullable>
Source:

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
Source:

# createReadStream(optsnullable) → {Stream}

Creates a read stream for the asset URI.
Parameters:
Name Type Attributes Description
opts Object <nullable>
Source:
Returns:
Type
Stream

# ready(callback)

Wait for asset to be ready (opened) calling `callback()` when it is.
Parameters:
Name Type Description
callback function
Source: