File: README.md

package info (click to toggle)
node-write-file-promise 1.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 96 kB
  • sloc: javascript: 33; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 444 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 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`.