Interface for doing filesystem operations on the platform.

Hierarchy

  • Filesystem

Methods

  • The time, in ms since POSIX epoch, that the file was last modified.

    Parameters

    • path: string

      The path to get a timestamp for.

    Returns Promise<number>

    A promise which will resolve to a timestamp if successful, or be rejected if the operation fails.

  • Read a file into a utf8 encoded string.

    Parameters

    • path: string

      The path of the file to read.

    Returns Promise<string>

    A promise which will resolve to utf8 encoded file content, or be rejected if the operation fails.

  • Watch for changes to the specified path.

    The implementation of this methods should be non-persistent. Meaning that it should not keep the containing process running as long as it is executing. For node this means setting the persistent option to false.

    Parameters

    • path: string

      The path to watch.

    • callback: ((eventType, filename) => void)
        • (eventType, filename): void
        • Parameters

          • eventType: string
          • filename: string

          Returns void

    Returns WatchHandle

    An async iterator that watches for changes to path.

Generated using TypeDoc