html-bundler-webpack-plugin
Version:
Generates complete single-page or multi-page website from source assets. Built-in support for Markdown, Eta, EJS, Handlebars, Nunjucks, Pug. Alternative to html-webpack-plugin.
19 lines (16 loc) • 323 B
JavaScript
const fs = require('fs');
/**
* Check whether the file exists.
*
* @param {string} file The file path.
* @return {Promise<boolean>}
*/
function fileExistsAsync(file) {
return fs.promises
.access(file, fs.constants.F_OK)
.then(() => true)
.catch(() => false);
}
module.exports = {
fileExistsAsync,
};