fs-mktemp

1.1.3 • Public • Published

fs-mktemp

npm Package License build status downloads per month Greenkeeper badge

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());

Readme

Keywords

Package Sidebar

Install

npm i fs-mktemp

Weekly Downloads

121

Version

1.1.3

License

MIT

Unpacked Size

109 kB

Total Files

29

Last publish

Collaborators

  • honzahommer