tempfile-stream

    1.0.0 • Public • Published

    tempfile-stream

    makes a temporary file to write to, which is deleted on process.exit

    usage

    var tempfile = require('tempfile-stream')
     
    var file$ = tempfile('.js') // specify extension if needed
     
    var filename = file$.path()
     
    file$.write('console.log("foobar")')
     
    // test
    var fs = require('fs')
    console.log(filename)
    fs.readFile(filename, function (error, filecontent) {
      if (error) throw error
      console.log(filecontent.toString())
    })

    Install

    npm i tempfile-stream

    DownloadsWeekly Downloads

    2

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • serapath