@mondaycom/apps-cli
Version:
A cli tool to manage apps (and monday-code projects) in monday.com
18 lines (17 loc) • 498 B
JavaScript
import { promises as fs } from 'node:fs';
import logger from './logger.js';
export class FSError extends Error {
constructor(message) {
super(message);
this.message = message;
}
}
export const saveToFile = async (filePath, content) => {
try {
await fs.writeFile(filePath, content, 'utf8');
}
catch (error) {
logger.debug(error);
throw new FSError(`Failed to save file, please check if this file path "${filePath}" is correct.`);
}
};