$ cnpm install write-yaml-file
Stringify and write YAML to a file atomically
Creates directories for you as needed.
<pnpm|yarn|npm> add write-yaml-file
const writeYamlFile = require('write-yaml-file')
writeYamlFile('foo.yaml', {foo: true}).then(() => {
console.log('done')
})
writeYamlFile(filepath, data, [options])Returns a promise.
writeYamlFile.sync(filepath, data, [options])optionsSame options that can be passed in to js-yaml
Type: number
Default 438 (0666 in octal)
Mode used when writing the file.
Type: boolean
Default: true
Creates the directory to which the YAML file is written.
Copyright 2013 - present © cnpmjs.org | Home |