storage API

Read

Read a file resource under as specified by path.

 await storageInterface.read("index/");

Parameters

path
string - resource path. The base path is the path of the current project. This can be changed with the component and project parameters
component
string - The base path will be changed to the one associated with the global component linked with this parameter.
project
string - The base path will be changed to the one associated with the global component linked with this parameter. Component parameter will be ignored.

Return Value

A Promise that resolves based on the mime type associated with the path.
If the mime type is recognized as text, a string will be returned.If the mime type is recognized as json, a JSON object will be returned.In all other cases, a blob will be returned

Description

This method read files within a tilepiece project.
You can change the path by specifying the component and project parameters