1.1.3 • Published 5 years ago

fs-mktemp v1.1.3

Weekly downloads
11
License
MIT
Repository
github
Last release
5 years ago

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

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago