Skip to content
This repository was archived by the owner on Sep 30, 2018. It is now read-only.

zkochan/write-yaml-file

Repository files navigation

this package has been moved to https://github.com/zkochan/packages/tree/master/write-yaml-file

write-yaml-file

Build Status

Stringify and write YAML to a file atomically

Creates directories for you as needed.

Installation

npm i -S write-yaml-file

Usage

const writeYamlFile = require('write-yaml-file')

writeYamlFile('foo.yaml', {foo: true}).then(() => {
  console.log('done')
})

API

writeYamlFile(filepath, data, [options])

Returns a promise.

writeYamlFile.sync(filepath, data, [options])

options

Same options that can be passed in to js-yaml

mode

Type: number
Default 438 (0666 in octal)

Mode used when writing the file.

Related

License

MIT © Zoltan Kochan

About

Stringify and write YAML to a file atomically

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published