tempfile-stream
v1.0.0
Published
creates a temporary file, that has a filename, can be written to and read from and is deleted on process.exit
Downloads
2
Readme
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())
})