Asset

Read bundled plugin assets as text or bytes.

Methods
2
Fields
None

Getting one

Asset

Methods

MethodReturnsDescription
bytes(string)stringRead a bundled asset as raw bytes.
text(string)stringRead a bundled asset as UTF-8 text.

Method details

bytes

bytes: (string) -> string

Read a bundled asset as raw bytes.

path
Package-relative path, e.g. "assets/icon.png".

text

text: (string) -> string

Read a bundled asset as UTF-8 text.

path
Package-relative path.
Returns
Errors when the bytes are not valid UTF-8.