mirror of
https://github.com/cloudflare/wrangler-action.git
synced 2025-01-23 05:44:46 +01:00
14 lines
416 B
JavaScript
14 lines
416 B
JavaScript
'use strict'
|
|
|
|
const fs = require('graceful-fs')
|
|
const pify = require('pify')
|
|
const stripBom = require('strip-bom')
|
|
const yaml = require('js-yaml')
|
|
|
|
const parse = data => yaml.safeLoad(stripBom(data))
|
|
|
|
const readYamlFile = fp => pify(fs.readFile)(fp, 'utf8').then(data => parse(data))
|
|
|
|
module.exports = readYamlFile
|
|
module.exports.default = readYamlFile
|
|
module.exports.sync = fp => parse(fs.readFileSync(fp, 'utf8'))
|