Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tmp

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tmp - npm Package Compare versions

Comparing version 0.0.17 to 0.0.18

29

lib/tmp.js
/*!
* Tmp
* Copyright (c) 2011 KARASZI Istvan <github@spam.raszi.hu>
* GPLv2 Licensed
*
* Copyright (c) 2011-2013 KARASZI Istvan <github@spam.raszi.hu>
*
* MIT Licensed
*/

@@ -30,3 +32,6 @@

// this will hold the objects need to be removed on exit
_removeObjects = [];
_removeObjects = [],
_gracefulCleanup = false,
_uncaughtException = false;

@@ -235,2 +240,6 @@ /**

function _garbageCollector() {
if (_uncaughtException && !_gracefulCleanup) {
return;
}
for (var i = 0, length = _removeObjects.length; i < length; i++) {

@@ -245,10 +254,10 @@ try {

function _gracefulCleanup() {
process.on('uncaughtException', function (err) {
_garbageCollector();
throw err;
});
function _setGracefulCleanup() {
_gracefulCleanup = true;
}
// adding to the exit listener
process.addListener('uncaughtException', function _uncaughtExceptionThrown() {
_uncaughtException = true;
});
process.addListener('exit', _garbageCollector);

@@ -261,2 +270,2 @@

module.exports.tmpName = _getTmpName;
module.exports.setGracefulCleanup = _gracefulCleanup;
module.exports.setGracefulCleanup = _setGracefulCleanup;
{
"name": "tmp",
"version": "0.0.17",
"version": "0.0.18",
"description": "Temporary file and directory creator",

@@ -39,4 +39,4 @@ "author": "KARASZI István <github@spam.raszi.hu> (http://raszi.hu/)",

"devDependencies": {
"vows": "~0.6.3"
"vows": "~0.7.0"
}
}

@@ -59,2 +59,5 @@ # Tmp

If you want to cleanup the directory even when there are entries in it, then
you can pass the `unsafeCleanup` option when creating it.
### Filename generation

@@ -61,0 +64,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc