Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
fs.outputFileAsync = (file, data) => new Promise((resolve, reject) => {
try {
fs.outputFileSync(file, data);
resolve();
} catch (err) {
reject(err);
}
});
fs.outputJsonSync = (file, jsonData) => {
fs.outputFileSync(file, JSON.stringify(jsonData));
};