# @ungap/weakmap

> An essential WeakMap polyfill for legacy browsers.

Latest version **0.2.1** (published 2020-06-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install @ungap/weakmap
pnpm add @ungap/weakmap
yarn add @ungap/weakmap
bun add @ungap/weakmap
```

## Health

**Score 28/100 (F)** — status: abandoned.

Positive: has types package; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2020-06-21 |
| First published | 2018-11-21 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | separate (@types/ungap__weakmap) |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | Andrea Giammarchi |
| Maintainers | webreflection |
| Keywords | WeakMap, polyfill, legacy, ungap |

## Links

- npm: https://www.npmjs.com/package/@ungap/weakmap
- Repository: https://github.com/ungap/weakmap
- Homepage: https://github.com/ungap/weakmap#readme
- Issues: https://github.com/ungap/weakmap/issues
- npm.io page: https://npm.io/package/@ungap/weakmap

## Recent versions

- 0.2.1 (latest) — 2020-06-21
- 0.2.0 — 2020-05-02
- 0.1.4 — 2018-11-23
- 0.1.3 — 2018-11-23
- 0.1.2 — 2018-11-22
- 0.1.1 — 2018-11-21
- 0.1.0 — 2018-11-21

## README

# WeakMap

[![Build Status](https://travis-ci.com/ungap/weakmap.svg?branch=master)](https://travis-ci.com/ungap/weakmap) [![Coverage Status](https://coveralls.io/repos/github/ungap/weakmap/badge.svg?branch=master)](https://coveralls.io/github/ungap/weakmap?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/ungap/weakmap.svg)](https://greenkeeper.io/) ![WebReflection status](https://offline.report/status/webreflection.svg)

An essential [WeakMap](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) polyfill for legacy browsers (IE < 11).

  * CDN via https://unpkg.com/@ungap/weakmap
  * ESM via `import WeakMap from '@ungap/weakmap'`
  * CJS via `const WeakMap = require('@ungap/weakmap')`

Compatible down to IE9, works well with ES5 shim upfront in IE8 (and maybe lower too).

[Live test](https://ungap.github.io/weakmap/test/)

### Transpiled code and frozen objects in legacy browsers

If you need this module to work in IE < 11 too with frozen objects, or template literals frozen via Babel transpilation, you need to either nullify `Object.freeze` and others via something like `<script>this.WeakMap||(Object.freeze=Object);</script>` on top of your pages, or you can nullify only template literals through:

```html
<script>
this.WeakMap||(function(O,f){
  f=O.freeze||O;O.freeze=function(o){return'raw'in o?o:f(o)}
}(Object));
</script>
```

---
_Source: https://npm.io/package/@ungap/weakmap · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
