MCPcopy
hub / github.com/remix-run/remix / writeFile

Function writeFile

packages/fs/src/lib/fs.ts:93–101  ·  view source on GitHub ↗
(
  to: string | number | fs.promises.FileHandle,
  file: { stream(): ReadableStream<Uint8Array> },
)

Source from the content-addressed store, hash-verified

91 * @returns A promise that resolves when the file is written
92 */
93export function writeFile(
94 to: string | number | fs.promises.FileHandle,
95 file: { stream(): ReadableStream<Uint8Array> },
96): Promise<void> {
97 let writeStream =
98 typeof to === 'string' ? fs.createWriteStream(to) : fs.createWriteStream('ignored', { fd: to })
99
100 return writeToStream(writeStream, file.stream())
101}
102
103async function writeToStream(
104 writeStream: fs.WriteStream,

Callers 5

putFileFunction · 0.90
fs.test.tsFile · 0.90
mainFunction · 0.50
makeMigrationFunction · 0.50

Calls 2

writeToStreamFunction · 0.85
streamMethod · 0.65

Tested by 1

makeMigrationFunction · 0.40

Used in the wild real call sites across dependent graphs

searching dependent graphs…