Socket
Socket
Sign inDemoInstall

fs-writefile-promise

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fs-writefile-promise

Promise version of fs.writefile


Version published
Weekly downloads
49K
decreased by-4.64%
Maintainers
1
Weekly downloads
 
Created
Source

fs-writefile-promise version License

Promise version of fs.writefile:

Asynchronously writes data to a file, replacing the file if it already exists.

Build Status Downloads Code Climate Coverage Status Dependencies

Install

npm install --save fs-writefile-promise

API

var write = require('fs-writefile-promise')

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(function (filename) {
    console.log(filename) //=> '/tmp/foo'
  })

  .catch(function (err) {
    console.error(err)
  })
})
options

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

License

ISC License © Ahmad Nassri

Keywords

FAQs

Package last updated on 18 Aug 2015

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc