UNPKG

statistician

Version:

Create and compare files stats, and webpack bundle stats

19 lines (17 loc) 297 B
const {promisify} = require('util'); const fs = require('fs'); const FUNCTIONS = [ 'readdir', 'readFile', 'stat', ]; /** * "Promisified" versions of fs functions */ module.exports = FUNCTIONS.reduce( (accumulator, fn) => Object.assign( accumulator, {[fn]: promisify(fs[fn])} ), {} );