# weakable

> Returns true if a value can be used as a WeakSet item or a WeakMap key.

Latest version **1.0.0** (published 2017-11-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install weakable
pnpm add weakable
yarn add weakable
bun add weakable
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-11-28 |
| First published | 2017-11-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4.0.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | John Lamansky |
| Maintainers | lamansky |
| Keywords | weak, WeakSet, WeakMap, key, object |

## Links

- npm: https://www.npmjs.com/package/weakable
- Repository: https://github.com/lamansky/weakable
- Issues: https://github.com/lamansky/weakable/issues
- npm.io page: https://npm.io/package/weakable

## Recent versions

- 1.0.0 (latest) — 2017-11-28

## README

# weakable

A Node.js module that returns true if a value can be used as a WeakSet item or a WeakMap key.

## Installation

```bash
npm install weakable --save
```

## Usage

```javascript
const weakable = require('weakable')
const set = new WeakSet()

const obj = {}
weakable(obj) // true
set.add(obj)

const str = 'test'
weakable(str) // false
set.add(str) // Uncaught TypeError: Invalid value used in weak set
```

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