MCPcopy Create free account
hub / github.com/Effect-TS/effect / file

Function file

packages/effect/src/unstable/http/HttpServerResponse.ts:484–494  ·  view source on GitHub ↗
(
  path: string,
  options?:
    | (Options & {
      readonly bytesToRead?: FileSystem.SizeInput | undefined
      readonly chunkSize?: FileSystem.SizeInput | undefined
      readonly offset?: FileSystem.SizeInput | undefined
    })
    | undefined
)

Source from the content-addressed store, hash-verified

482 * @since 4.0.0
483 */
484export const file = (
485 path: string,
486 options?:
487 | (Options & {
488 readonly bytesToRead?: FileSystem.SizeInput | undefined
489 readonly chunkSize?: FileSystem.SizeInput | undefined
490 readonly offset?: FileSystem.SizeInput | undefined
491 })
492 | undefined
493): Effect.Effect<HttpServerResponse, PlatformError, HttpPlatform> =>
494 Effect.flatMap(HttpPlatformKey, (platform) => platform.fileResponse(path, options))
495
496/**
497 * Creates a streamed file response for a Web `File`-like value.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected