write-yaml-file
TypeScript icon, indicating that this package has built-in type declarations

5.0.0 • Public • Published

write-yaml-file

Stringify and write YAML to a file atomically

Creates directories for you as needed.

Installation

<pnpm|yarn|npm> add 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.

makeDir

Type: boolean Default: true

Creates the directory to which the YAML file is written.

Related

License

MIT © Zoltan Kochan

Package Sidebar

Install

npm i write-yaml-file

Weekly Downloads

505,870

Version

5.0.0

License

MIT

Unpacked Size

4.04 kB

Total Files

5

Last publish

Collaborators

  • zkochan