Codebase list node-write-file-promise / 19c7bff7-187e-4e8c-9b1e-07af06b675d9/upstream
19c7bff7-187e-4e8c-9b1e-07af06b675d9/upstream

Tree @19c7bff7-187e-4e8c-9b1e-07af06b675d9/upstream (Download .tar.gz)

# write-file-promise

Write a file creating intermediate directories

## Installation

`npm install --save write-file-promise`

## Usage

```js
const write = require('write-file-promise');

write('/tmp/create/file.log', data)
.then(() => {})
.catch(() => {})
```

The module creates intermediate directories `tmp` and `create` if they don't exist already.

`write` has the same signature of `fs.writeFile` except the last parameter `callback`.