lib/node-yaml.js
async function write(filename, object, options = undefined) {
  const {encoding, flag, ...opts} = normalizeOptions(options)

  if (!isNumber(filename)) {
    filename = toAbsolute(base, filename)

    opts.filename = filename
  }

  await fs.writeFile(filename, yaml.dump(object, opts), {encoding, flag})
}
async function write(filename, object, options = undefined) {
  const {encoding, flag, ...opts} = normalizeOptions(options)

  if (!isNumber(filename)) {
    filename = toAbsolute(base, filename)

    opts.filename = filename
  }

  await fs.writeFile(filename, yaml.dump(object, opts), {encoding, flag})
}
async function write ( filename , object , options = undefined ) { const { encoding , flag , ... opts } = normalizeOptions ( options ) if ( ! isNumber ( filename ) ) { filename = toAbsolute ( base , filename ) opts . filename = filename } await fs . writeFile ( filename , yaml . dump ( object , opts ) , { encoding , flag } ) }
Write given YAML content to disk

@param {string | number} filename
@param {object} object
@param {options} [options = undefined]

@return {void}

@api public
Write given YAML content to disk