JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 375
  • Score
    100M100P100Q76288F

safer file writing for node

Package Exports

  • writefile
  • writefile/stream

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (writefile) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

writefile

safer file writing for node

Getting Started

With npm

$ npm install writefile --save

then in your app:

var writefile = require('writefile')

API

both these function return Results though they expose their internal callback based APIs as fn.plain. Feel free to use those functions instead.

fromBuffer(path:String, text:String)

fs.writeFile() but makes parent directories if required

fromStream(path:String, text:Stream)

as above but accepts a Stream instead of a String

Running the tests

$ npm install
$ node test