Unsubscribes from a file stream, decrementing its usage counter. If the counter reaches zero, the file stream is closed automatically.

Thrown if the environment is not a Node.js server.

Thrown if no subscriptions are found for the file stream.

Thrown if the file stream to unsubscribe from does not exist.

Thrown if an unexpected error occurs while unsubscribing from the file stream.

  • Parameters

    • filePath: string

      Path to the file of the stream to unsubscribe from.

    Returns Promise<void>

    A promise that resolves when the unsubscription is successful.