Socket
Socket
Sign inDemoInstall

fs-writefile-promise

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    fs-writefile-promise

Promise version of fs.writefile


Version published
Weekly downloads
50K
increased by4.98%
Maintainers
1
Install size
5.14 kB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 18 Feb 2019

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