
Research
Node.js Fixes AsyncLocalStorage Crash Bug That Could Take Down Production Servers
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.
weakmap.prototype.getorinsert
Advanced tools
ES Proposal spec-compliant shim for WeakMap.prototype.getOrInsert
An ESnext spec-compliant WeakMap.prototype.getOrInsert shim/polyfill/replacement that works as far down as ES3.
This package implements the es-shim API v3 interface. It works in an ES3-supported environment and complies with the proposed spec.
npm install --save weakmap.prototype.getorinsert
var getOrInsert = require('weakmap.prototype.getorinsert');
var assert = require('assert');
var map = new WeakMap();
var key = {};
var value = {};
assert.equal(map.has(key), false);
assert.equal(getOrInsert(map, key, value), value);
assert.equal(map.has(key), true);
var getPolyfill = require('weakmap.prototype.getorinsert/polyfill');
var shim = require('weakmap.prototype.getorinsert/shim');
var assert = require('assert');
/* when WeakMap.prototype.getOrInsert is not present */
delete WeakMap.prototype.getOrInsert;
var shimmed = shim();
assert.equal(shimmed, getPolyfill());
var map = new WeakMap();
var key = {};
var value = {};
assert.equal(map.has(key), false);
assert.equal(map.getOrInsert(key, value), value);
assert.equal(map.has(key), true);
var shim = require('weakmap.prototype.getorinsert/shim');
var assert = require('assert');
/* when WeakMap.prototype.getOrInsert is present */
var shimmed = shim();
assert.equal(shimmed, WeakMap.prototype.getOrInsert);
var map = new WeakMap();
var key = {};
var value = {};
assert.equal(map.has(key), false);
assert.equal(map.getOrInsert(key, value), value);
assert.equal(map.has(key), true);
Simply clone the repo, npm install, and run npm test
FAQs
ES Proposal spec-compliant shim for WeakMap.prototype.getOrInsert
We found that weakmap.prototype.getorinsert demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.

Research
/Security News
A malicious Chrome extension steals newly created MEXC API keys, exfiltrates them to Telegram, and enables full account takeover with trading and withdrawal rights.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.