UNPKG

@thi.ng/file-io

Version:

Assorted file I/O utils (with logging support) for NodeJS/Bun

20 lines 747 B
import type { Fn3, Maybe, Nullable, NumOrString } from "@thi.ng/api"; import type { ILogger } from "@thi.ng/logger"; export declare const readJSON: <T = any>(path: string, logger?: ILogger) => T; /** * Serializes `obj` to JSON and writes result to UTF-8 file `path`. See * {@link writeText} for more details. * * @remarks * The `replacer` and `space` args are the same as supported by * `JSON.stringify()`. * * @param path * @param obj * @param replacer * @param space * @param logger * @param dryRun */ export declare const writeJSON: (path: string, obj: any, replacer?: Fn3<any, string, any, any> | Nullable<NumOrString[]>, space?: Maybe<NumOrString>, logger?: ILogger, dryRun?: boolean) => void; //# sourceMappingURL=json.d.ts.map