end of day
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import * as fs from 'node:fs'
|
||||
import * as fsp from 'node:fs/promises'
|
||||
|
||||
export default class NodeFileSystemWriteableFileStream implements FileSystemWritableFileStream {
|
||||
#name:string
|
||||
constructor(name: string, options?: FileSystemCreateWritableOptions) {
|
||||
if (options.keepExistingData) {
|
||||
|
||||
}
|
||||
this.#name=name
|
||||
}
|
||||
seek(position: number): Promise<void> {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
truncate(size: number): Promise<void> {
|
||||
return fsp.truncate(this.#name,size)
|
||||
}
|
||||
async write(data: FileSystemWriteChunkType): Promise<void> {
|
||||
return fsp.writeFile(this.#name,(data as string))
|
||||
}
|
||||
locked: boolean;
|
||||
abort(reason?: any): Promise<void> {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
close(): Promise<void> {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
getWriter(): WritableStreamDefaultWriter<any> {
|
||||
throw new Error("Method not implemented")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user