on-exit-leak-free
Advanced tools
Comparing version 0.2.0 to 1.0.0
10
index.js
@@ -6,4 +6,4 @@ 'use strict' | ||
const obj = ref.deref() | ||
// This should alway happen, however GC is | ||
// undeterministic so it might happen. | ||
// This should always happen, however GC is | ||
// undeterministic so it might not happen. | ||
/* istanbul ignore else */ | ||
@@ -16,2 +16,8 @@ if (obj !== undefined) { | ||
wraps[event] = wrap | ||
// We are allowing infinite amount of listeners added | ||
// by on-exit-leak-free | ||
const maxListeners = process.getMaxListeners() | ||
if (process.listenerCount(event) === maxListeners) { | ||
process.setMaxListeners(maxListeners + 1) | ||
} | ||
process.once(event, wrap) | ||
@@ -18,0 +24,0 @@ } |
{ | ||
"name": "on-exit-leak-free", | ||
"version": "0.2.0", | ||
"version": "1.0.0", | ||
"description": "Execute a function on exit without leaking memory, allowing all objects to be garbage collected", | ||
@@ -32,4 +32,4 @@ "main": "index.js", | ||
"standard": "^16.0.3", | ||
"tap": "^15.0.9" | ||
"tap": "^16.0.0" | ||
} | ||
} |
# on-exit-leak-free | ||
Execute a function on exit without leaking memory, allowing all objects to be garbage collected. | ||
Listen to both `'beforeExit'` and `'exit`, executing the given function only once. | ||
Listen to both `'beforeExit'` and `'exit'`, executing the given function only once. | ||
@@ -6,0 +6,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
8254
12
173
0