UNPKG

frankie

Version:

A snailish mocha reporter

22 lines (16 loc) 495 B
const fs = require('fs'); const path = require('path'); const artDir = path.join(__dirname, 'art'); const artPaths = fs.readdirSync(artDir); const art = {}; artPaths.forEach((artPath) => { const file = fs.readFileSync(path.join(artDir, artPath)).toString(); const lines = file.split('\n'); const name = artPath.replace('.txt', ''); art[name] = { art: file, height: lines.length, width: Math.max.apply(null, lines.map(line => line.length)) }; }); module.exports = art;