fs-mktemp
v1.1.3
Published
`mktemp` command for Node.js
Downloads
695
Readme
fs-mktemp
mktemp
command for Node.js
Installation
npm install fs-mktemp
Usage
mktempDir([prefix='tmp'], [callback]);
prefix
<String>
callback
<Function>
Example
const { mktempDir } = require('fs-mktemp');
mktempDir((err, dir) => {
if (err) {
return console.error(err);
}
console.log(dir);
});
mktempDir()
.then(dir => {
console.log(dir);
})
.catch(err => {
console.error(err);
});
mktempDirSync([prefix='tmp'])
prefix
<String>
Example
const { mktempDirSync } = require('fs-mktemp');
console.log(mktempDirSync());
mktempFile([options={content:'',prefix:'tmp'}|prefix='tmp'], [callback])
options
<Object>
options.content
<String>
options.prefix
<String>
callback
<Function>
- or -
prefix
<String>
callback
<Function>
Example
const { mktempFile } = require('fs-mktemp');
mktempFile((err, file) => {
if (err) {
return console.error(err);
}
console.log(file);
});
mktempFile()
.then(file => {
console.log(file);
})
.catch(err => {
console.error(err);
});
mktempFileSync([options={content:'',prefix:'tmp'}|prefix='tmp'])
options
<Object>
options.content
<String>
options.prefix
<String>
- or -
prefix
<String>
Example
const { mktempFileSync } = require('fs-mktemp');
console.log(mktempFileSync());