zazoomauro/node-dependency-injection

View on GitHub
lib/Dump/YamlDumper.js

Summary

Maintainability
A
1 hr
Test Coverage
A
100%
import fs from 'fs/promises'
import yaml from 'js-yaml'
import Dumper from './Dumper'

export default class YamlDumper extends Dumper {
  async dump () {
    const dataContent = yaml.dump(this._content)
    await fs.writeFile(
      this._serviceFile,
      dataContent,
      { encoding: 'utf8' }
    )
  }
}