JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 792466
  • Score
    100M100P100Q176371F
  • License MIT

Create and remove temporary directories with minimal effort

Package Exports

  • quick-temp

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (quick-temp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.

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.