mirror of
https://github.com/cloudflare/wrangler-action.git
synced 2024-12-01 14:14:44 +01:00
12 lines
343 B
JavaScript
12 lines
343 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))
|
||
|
|
||
|
module.exports = fp => pify(fs.readFile)(fp, 'utf8').then(data => parse(data))
|
||
|
module.exports.sync = fp => parse(fs.readFileSync(fp, 'utf8'))
|