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

on-exit-leak-free

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

on-exit-leak-free - npm Package Compare versions

Comparing version 0.2.0 to 1.0.0

test/event-emitter-leak.test.js

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 @@ }

4

package.json
{
"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

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