MCPcopy
hub / github.com/Effect-TS/effect / file

Function file

packages/platform/src/internal/httpBody.ts:142–155  ·  view source on GitHub ↗
(
  path: string,
  options?: FileSystem.StreamOptions & { readonly contentType?: string }
)

Source from the content-addressed store, hash-verified

140
141/** @internal */
142export const file = (
143 path: string,
144 options?: FileSystem.StreamOptions & { readonly contentType?: string }
145): Effect.Effect<Body.Stream, PlatformError.PlatformError, FileSystem.FileSystem> =>
146 Effect.flatMap(
147 FileSystem.FileSystem,
148 (fs) =>
149 Effect.map(fs.stat(path), (info) =>
150 stream(
151 fs.stream(path, options),
152 options?.contentType,
153 Number(info.size)
154 ))
155 )
156
157/** @internal */
158export const fileInfo = (

Callers

nothing calls this directly

Calls 5

NumberInterface · 0.85
statMethod · 0.80
streamFunction · 0.70
mapMethod · 0.65
streamMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…