SmythOS SDK
    Preparing search index...

    Class StorageInstance

    Base class for all SDK objects.

    This class provides a base implementation for all SDK objects. It handles event emission, promise management, and initialization.

    This object is used to ensure that an SRE instance is initialized, and if not, create one with default settings.

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    Methods

    • Delete a resource from the storage

      Parameters

      • resourceName: string

        The name or smythfs:// uri of the resource to delete

      Returns Promise<string>

      SmythFS URI of the deleted resource in the format (smythfs://./)

    • Check if a resource exists in the storage

      Parameters

      • resourceName: string

        The name or smythfs:// uri of the resource to check

      Returns Promise<string>

      true if the resource exists, false otherwise

    • Read a resource from the storage

      Parameters

      • resourceName: string

        The name or smythfs:// uri of the resource to read

      Returns Promise<Buffer<ArrayBufferLike>>

      the resource data

    • Write a resource to the storage

      Parameters

      • resourceName: string

        The name or smythfs:// uri of the resource to write

      • data: StorageData

        The data to write to the resource

      Returns Promise<string>

      SmythFS URI of the written resource in the format (smythfs://./)