write-json-safe
Version:
Write formatted JSON to a file
12 lines (11 loc) • 512 B
TypeScript
import { Options as WriteFileOptions } from "write-file-safe";
import { OptionalJSONValue } from "stringify-json-object";
export type Options = {
/**
* Output formatted JSON. Default: `true`
*/
pretty?: boolean;
} & WriteFileOptions;
export declare function writeJSON(path: string, content?: OptionalJSONValue, options?: Options): Promise<boolean>;
export declare function writeJSONSync(path: string, content?: OptionalJSONValue, options?: Options): boolean;
export type { OptionalJSONValue };