@stryke/fs
Version:
A package containing various file system utilities that expand the functionality of NodeJs's built-in `fs` module.
32 lines • 1.45 kB
text/typescript
//#region src/buffer.d.ts
/**
* Reads a file from the given path and returns its content as an ArrayBuffer. The file is expected to be located relative to the current directory of this module.
*
* @param filePath - The path to the file to read.
* @returns The content of the file as an ArrayBuffer.
*/
declare function readFileBuffer(filePath: string): Promise<ArrayBuffer>;
/**
* Reads a file from the given path and returns its content as an ArrayBuffer. The file is expected to be located relative to the current directory of this module.
*
* @param filePath - The path to the file to read.
* @returns The content of the file as an ArrayBuffer.
*/
declare function readFileBufferSync(filePath: string): ArrayBuffer;
/**
* Writes an ArrayBuffer to a file at the specified path.
*
* @param filePath - The path to the file where the data should be written.
* @param data - The ArrayBuffer containing the data to write.
*/
declare function writeFileBuffer(filePath: string, data: ArrayBuffer): Promise<void>;
/**
* Writes an ArrayBuffer to a file at the specified path.
*
* @param filePath - The path to the file where the data should be written.
* @param data - The ArrayBuffer containing the data to write.
*/
declare function writeFileBufferSync(filePath: string, data: ArrayBuffer): void;
//#endregion
export { readFileBuffer, readFileBufferSync, writeFileBuffer, writeFileBufferSync };
//# sourceMappingURL=buffer.d.mts.map