1.0.3 • Published 9 years ago
tmpr v1.0.3
tmpr
Creates a temorary directory and then gives you the path to it. mkdirp
(os.tmpdir
+ crypto.randomBytes
), tests, and possibly a few other conerns.
Install
$ npm i tmpr -g
API
var tmpr = require('tmpr')
tmpr(function(err, path) {
console.log('Temp dir created at ' + path)
})
References
- https://iojs.org/api/os.html#os_os_tmpdir
- https://iojs.org/api/crypto.html#crypto_crypto_randombytes_size_callback
- https://github.com/substack/node-mkdirp
- https://github.com/isaacs/rimraf
ogd bret: require('os').tmpdir
ogd i use that with require('mkdirp') and require('rimraf') a lot
ogd bret: usually like ~~(Math.random() * 1000000) + Date.now()
ogd could also do require('crypto').randomBytes(16).toString('hex')