PluginDataFiles
Files in the plugin’s private data folder, which needs the "files.pluginData" permission.
Names are paths inside the folder, such as "cache/parts.json". The folder holds at most
1 GiB in 10,000 files and folders; a write that would go over throws a RangeError.
Methods
Section titled “Methods”list()
Section titled “list()”list(): readonly
string[]
The names of all the files, sorted.
Returns
Section titled “Returns”readonly string[]
readBytes()
Section titled “readBytes()”readBytes(
name):Uint8Array<ArrayBufferLike> |null
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Uint8Array<ArrayBufferLike> | null
readText()
Section titled “readText()”readText(
name):string|null
Returns the file’s text, or null when there is no such file.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string | null
remove()
Section titled “remove()”remove(
name):boolean
Removes a file; returns whether there was one.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”boolean
writeBytes()
Section titled “writeBytes()”writeBytes(
name,bytes):void
Parameters
Section titled “Parameters”string
ArrayBuffer | Uint8Array<ArrayBufferLike>
Returns
Section titled “Returns”void
writeText()
Section titled “writeText()”writeText(
name,text):void
Creates or replaces a file, and the folders it is in.
Parameters
Section titled “Parameters”string
string
Returns
Section titled “Returns”void