Sha256: 1661811bf1e485dc568033a332d8d100e546bec82c1089f7549fc6769237f1b8
Contents?: true
Size: 633 Bytes
Versions: 26
Compression:
Stored size: 633 Bytes
Contents
// 'use strict'; const parseJson = require('parse-json'); const yaml = require('js-yaml'); const importFresh = require('import-fresh'); function loadJs(filepath ) { const result = importFresh(filepath); return result; } function loadJson(filepath , content ) { try { return parseJson(content); } catch (err) { err.message = `JSON Error in ${filepath}:\n${err.message}`; throw err; } } function loadYaml(filepath , content ) { return yaml.safeLoad(content, { filename: filepath }); } module.exports = { loadJs, loadJson, loadYaml, };
Version data entries
26 entries across 25 versions & 8 rubygems