Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "file-handlers"

Index

Type aliases

CallbackFn

CallbackFn: (err: Error | null, str?: undefined | string) => void

Type declaration

    • (err: Error | null, str?: undefined | string): void
    • Parameters

      • err: Error | null
      • Optional str: undefined | string

      Returns void

Functions

handleCache

  • Get the template from a string or a file, either compiled on-the-fly or read from cache (if enabled), and cache the template if needed.

    If options.cache is true, this function reads the file from options.filename so it must be set prior to calling this function.

    static

    Parameters

    Returns TemplateFunction

    Depending on the value of options.client, either type might be returned.

includeFile

  • Get the template function.

    If options.cache is true, then the template is cached.

    static

    Parameters

    • path: string

      path for the specified file

    • options: SqrlConfig

      compilation options

    Returns (data: object, config: SqrlConfig, cb?: CallbackFn) => string

    Depending on the value of options.client, either type might be returned

renderFile

tryHandleCache

  • Try calling handleCache with the given options and data and call the callback with the result. If an error occurs, call the callback with the error. Used by renderFile().

    static

    Parameters

    Returns any

Generated using TypeDoc