quick-temp
Create and remove temporary directories with minimal effort
Last updated 3 years ago by joliss .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install quick-temp 
SYNC missed versions from official npm registry.

node-quick-temp

Create and remove temporary directories. Useful for build tools, like Broccoli plugins. Smart about naming, and placing them in ./tmp if possible, so you don't have to worry about this.

Installation

npm install --save quick-temp

Usage

var quickTemp = require('quick-temp');

Creating a temporary directory

To make a temporary and assign its path to this.tmpDestDir, call either one of these:

quickTemp.makeOrRemake(this, 'tmpDestDir');
// or
quickTemp.makeOrReuse(this, 'tmpDestDir');

If this.tmpDestDir already contains a path, makeOrRemake will remove it first and then create a new directory, whereas makeOrReuse will be a no-op.

Both functions also return the path of the temporary directory.

An optional third argument lets you override the class-name component of the temporary directory name:

quickTemp.makeOrRemake(this, 'tmpDestDir', 'TreeMerger');
quickTemp.makeOrRemake(this, 'tmpDestDir', this.constructor.name); // default

Removing a temporary directory

To remove a previously-created temporary directory and all its contents, call

quickTemp.remove(this, 'tmpDestDir');

This will also assign this.tmpDestDir = null. If this.tmpDestDir is already null or undefined, it will be a no-op.

Current Tags

  • 0.1.8                                ...           latest (3 years ago)

11 Versions

  • 0.1.8                                ...           3 years ago
  • 0.1.7                                ...           3 years ago
  • 0.1.6                                ...           4 years ago
  • 0.1.5                                ...           5 years ago
  • 0.1.4                                ...           5 years ago
  • 0.1.3                                ...           5 years ago
  • 0.1.2                                ...           6 years ago
  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           6 years ago
  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Downloads
Today 46
This Week 160
This Month 328
Last Day 53
Last Week 287
Last Month 910
Dependencies (3)
Dev Dependencies (0)
None
Dependents (84)

Copyright 2014 - 2016 © taobao.org |