@nutgaard/data-pack
Version:
Utility pack for working with random data
10 lines (9 loc) • 545 B
TypeScript
/// <reference types="node" />
import { WriteStream } from 'fs';
export declare function read(path: string): Promise<string>;
export declare function readSync(path: string): string;
export declare function readJSON<T>(path: string): Promise<T>;
export declare function readJSONSync<T>(path: string): T;
export declare function write(path: string, content: any): Promise<void>;
export declare function writeSync(path: string, content: any): void;
export declare function withWriteStream(path: string, block: (stream: WriteStream) => void): void;