postcss-plugins
Version:
A consolidated list of PostCSS plugins in an ready-to-use format.
14 lines (12 loc) • 467 B
JavaScript
const fs = require('fs');
/**
* writePlugins - Responsible for writing 'plugins.json'
*
* @param {Array} plugins The updated array of plugins
*
* @returns {Promise} Promise that will reject if there is an error writing the plugins
*/
const writePlugins = (plugins, path) => new Promise((res, rej) => {
fs.writeFile(path, JSON.stringify(plugins, null, 2), (e) => e ? rej(e) : res('Updated the plugins.json file.'));
});
module.exports = writePlugins;