@aws/pdk
Version:
All documentation is located at: https://aws.github.io/aws-pdk
56 lines (32 loc) • 1.02 kB
Markdown
> Stringify and write YAML to a file atomically
Creates directories for you as needed.
```
<pnpm|yarn|npm> add write-yaml-file
```
```js
const writeYamlFile = require('write-yaml-file')
writeYamlFile('foo.yaml', {foo: true}).then(() => {
console.log('done')
})
```
Returns a promise.
Same options that can be passed in to [js-yaml](https://www.npmjs.com/package/js-yaml#safedump-object---options-)
Type: `number`
Default `438` *(0666 in octal)*
[](https://en.wikipedia.org/wiki/File_system_permissions#Numeric_notation) used when writing the file.
Type: `boolean`
Default: `true`
Creates the directory to which the YAML file is written.
- [load-yaml-file](https://github.com/LinusU/load-yaml-file) - Read and parse a YAML file
[](LICENSE) © [Zoltan Kochan](https://www.kochan.io)