Asset.prototype.text

Return a string containing the contents of the asset.

It assumes the asset is UTF-8 encoded.

Syntax

text()

Return value

A string.

If the asset is too big to fit in a string, an error is thrown. In this case, use blob(), reader() or lines() to read its contents.

Examples

Asset("myasset").text()
"hello world"