Safely writes content to a file, creating parent directories if they don't exist.
The path to the file to be written.
The content to write to the file.
Optional
Optional settings for the write operation.
import { writeFileSafely } from "nsuite";await writeFileSafely("./logs/error.log", "Error message", { encoding: "utf8" }); Copy
import { writeFileSafely } from "nsuite";await writeFileSafely("./logs/error.log", "Error message", { encoding: "utf8" });
Safely writes content to a file, creating parent directories if they don't exist.