then-write-file

1.0.0 • Public • Published

then-write-file npmjs.com The MIT License

Write file to disk, using promises and creating intermediate directories if they don't exist.

code climate standard code style travis build status coverage status dependency status

Install

npm i then-write-file --save
npm test

Usage

For more use-cases see the tests

var thenWriteFile = require('then-write-file')
 
thenWriteFile('./foobar.txt', 'foo bar')
.then(function (res) {
  console.log(res)
  //=> true
})
.catch(console.error)

Related

  • then-parse-json: Gracefully parse JSON using promises - promisified JSON.parse
  • then-stringify-json: Gracefully stringify JSON using promises - promisified JSON.stringify
  • try-read-json: Fast, meaningful and correct try/catch flow for reading JSON with JSON.parse - support optional callback
  • then-read-json: Read JSON file using promises
  • then-write-json: Write contents to JSON file using JSON.stringify and promises. Creating intermediate directories if they don't exist.

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.

Charlike Make Reagent new message to charlike freenode #charlike

tunnckocore.tk keybase tunnckocore tunnckoCore npm tunnckoCore twitter tunnckoCore github

Package Sidebar

Install

npm i then-write-file

Weekly Downloads

2

Version

1.0.0

License

MIT

Last publish

Collaborators

  • vanchoy
  • tunnckocore