fs-writefile-promise

3.0.2 • Public • Published

fs.writeFile Promise

License version Build Status

Promise version of fs.writeFile:
Asynchronously writes data to a file, replacing the file if it already exists.

Install

npm install fs-writefile-promise

API

write(filename, data [, options])

  • filename: String
  • data String or Buffer
  • options: Object

Return: Object (Promise)

When it finishes, it will be fulfilled with the file name that was written to.

When it fails, it will be rejected with an error as its first argument.

write('/tmp/foo', 'bar')
  .then(filename => console.log(filename)) //=> '/tmp/foo'
  .catch(err => console.error(err))

options

The option object will be directly passed to fs.writeFile.


Author: Ahmad Nassri • Github: @ahmadnassri • Twitter: @AhmadNassri

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
3.0.2258latest

Version History

VersionDownloads (Last 7 Days)Published
3.0.2258
3.0.12
3.0.06
2.0.081
1.0.350,465
1.0.25
1.0.13
1.0.05

Package Sidebar

Install

npm i fs-writefile-promise

Weekly Downloads

50,825

Version

3.0.2

License

MIT

Unpacked Size

4.35 kB

Total Files

4

Last publish

Collaborators

  • ahmadnassri