Sha256: 7399565850b68f9ca79baba619149a30a75150b7c2e5a82eb5b7f5eba8a03f7f

Contents?: true

Size: 692 Bytes

Versions: 17

Compression:

Stored size: 692 Bytes

Contents

var path = require('path');
var fs = require('fs');
var os = require('os');
var rimraf = require('rimraf');
var log = require('./logger').create('temp-dir');

// Node v0.8 uses tmpDir(), v0.10 uses tmpdir().
var TEMP_DIR = os.tmpdir ? os.tmpdir() : os.tmpDir();

module.exports = {
  getPath: function(suffix) {
    return path.normalize(TEMP_DIR + suffix);
  },

  create: function(path) {
    log.debug('Creating temp dir at %s', path);

    try {
      fs.mkdirSync(path);
    } catch (e) {
      log.warn('Failed to create a temp dir at %s', path);
    }

    return path;
  },

  remove: function(path, done) {
    log.debug('Cleaning temp dir %s', path);
    rimraf(path, done);
  }
};

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
hooch-0.4.2 jasmine/node_modules/karma/lib/temp_dir.js
hooch-0.4.1 jasmine/node_modules/karma/lib/temp_dir.js
hooch-0.4.0 jasmine/node_modules/karma/lib/temp_dir.js
hooch-0.3.0 jasmine/node_modules/karma/lib/temp_dir.js
hooch-0.2.1 jasmine/node_modules/karma/lib/temp_dir.js
hooch-0.2.0 jasmine/node_modules/karma/lib/temp_dir.js
hooch-0.1.0 jasmine/node_modules/karma/lib/temp_dir.js
hooch-0.0.8 jasmine/node_modules/karma/lib/temp_dir.js
hooch-0.0.7 jasmine/node_modules/karma/lib/temp_dir.js
hooch-0.0.6 jasmine/node_modules/karma/lib/temp_dir.js
entangled-0.0.16 spec/dummy/public/node_modules/karma/lib/temp_dir.js
entangled-0.0.15 spec/dummy/public/node_modules/karma/lib/temp_dir.js
entangled-0.0.14 spec/dummy/public/node_modules/karma/lib/temp_dir.js
entangled-0.0.13 spec/dummy/public/node_modules/karma/lib/temp_dir.js
entangled-0.0.12 spec/dummy/public/node_modules/karma/lib/temp_dir.js
entangled-0.0.11 spec/dummy/public/node_modules/karma/lib/temp_dir.js
entangled-0.0.10 spec/dummy/public/node_modules/karma/lib/temp_dir.js