@grafctory/gear
    Preparing search index...

    Function getResource

    • Retrieves the text of a resource file.

      Reads a file shipped beside the calling module, such as a prompt or template, wherever the code is launched from.

      Parameters

      • url: URLLike

        The URL of the file, or a path resolved against base; a path made only of extensions, such as .sys.md, replaces the trailing extensions of base, so that module.js can name its companion module.sys.md

      • Optionalbase: URLLike

        The URL url is resolved against, typically the URL of the calling module, as given by import.meta.url

      Returns Promise<string>

      A promise resolving to the UTF-8 text of the file, rejected if the file can't be read

      TypeError If url is a path and base is missing or isn't a valid URL