mkdirtemp
v1.1.0
Published
Create a unique temporary directory.
Downloads
45,482
Maintainers
Readme
mkdirtemp
Create a unique temporary directory.
Why?
- Fixes the awkward
fs.mkdtemp()
API. - Supports
async
andawait
. - Sensible defaults.
Install
npm install mkdirtemp --save
Usage
Get it into your program.
const mkdirtemp = require('mkdirtemp');
Make a new and unique temporary directory.
mkdirtemp().then((dirPath) => {
console.log(dirPath);
// => /var/folders/gr/qfsxs2gj0fq1ypdsfd8rj8tr0000gn/T/MKufpq
});
API
mkdirtemp(cwd)
Returns a Promise
for the path of the new directory.
cwd
Type: string
Default: os.tmpdir()
Parent of the new directory once it is created.
Contributing
See our contributing guidelines for more details.
- Fork it.
- Make a feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request.
License
Go make something, dang it.