tmp-dir
Create unique tempdir directories.
You're probably looking for node-tmp.
I wrote this module while offline and wasn't sure if anything like it existed. Turns out it did, and with tests! So you really ought to use node-tmp instead!
Use os.tmpdir()
plus a GUID to create temporary directories in a
laissez-faire manner. Never worry about deducing your own unique name and
location for a throw-away directory!
Usage
var tmp =
API
var tmp =
tmp(work)
Creates a new temporary directory in /tmp/tmp-dir/some-unique-identifier
.
work
gets called once the directory is created, and has the form function (err, dir, cleanup) {}
. err
is set if the temp dir couldn't be created; dir
is the absolute path to the directory, and cleanup
is a function for you to
call when you are done with the directory for clean-up.
Install
With npm installed, run
$ npm install tmp-dir
See Also
License
ISC