UNPKG

@cake-hub/cake-screenshot_diffs

Version:

A CAKE Screenshot diffing tool that includes a setup to comapre two given resources by screenshots taken from the available pages.

22 lines (17 loc) 456 B
const yaml = require ("js-yaml"); const fs = require ("fs-extra"); class ParseYML { constructor (filePath) { this._filePath = filePath; } async parse () { try { const ymlAsJSON = yaml.load (await fs.readFile (this._filePath, 'utf8')); return ymlAsJSON; } catch (e) { console.error ("ParseYML", "parse ()", e); return null; } } } module.exports = ParseYML;