Socket
Socket
Sign inDemoInstall

write-yaml-file

Package Overview
Dependencies
5
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    write-yaml-file

Stringify and write YAML to a file atomically


Version published
Weekly downloads
457K
decreased by-8.92%
Maintainers
1
Install size
661 kB
Created
Weekly downloads
 

Readme

Source

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.

  • load-yaml-file - Read and parse a YAML file

License

MIT © Zoltan Kochan

Keywords

FAQs

Last updated on 27 Apr 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc