@eightshone/sshman
Version:
A simple cli ssh manager
16 lines (13 loc) • 347 B
text/typescript
import fs from "fs";
async function saveFile(
filePath: string,
data: any,
errorMessage: string = "Error updating config file file:"
): Promise<void> {
try {
await fs.promises.writeFile(filePath, JSON.stringify(data), "utf8");
} catch (error) {
console.error(errorMessage, error);
}
}
export default saveFile;