# set-prototype-of

> Object.setPrototypeOf Polyfill

Latest version **1.0.0** (published 2015-10-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install set-prototype-of
pnpm add set-prototype-of
yarn add set-prototype-of
bun add set-prototype-of
```

## 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 | 2015-10-10 |
| First published | 2015-10-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Tejesh Mehta |
| Maintainers | tjmehta |
| Keywords | object, setprototypeof, set, prototype, of, polyfill, es6 |

## Links

- npm: https://www.npmjs.com/package/set-prototype-of
- Repository: https://github.com/tjmehta/set-prototype-of
- Homepage: https://github.com/tjmehta/set-prototype-of#readme
- Issues: https://github.com/tjmehta/set-prototype-of/issues
- npm.io page: https://npm.io/package/set-prototype-of

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2015-10-10

## README

# Object.setPrototypeOf Polyfill (set-prototype-of)

### Example
```js
require('set-prototype-of'); // Object.setPrototypeOf Polyfill
Object.setPrototypeOf(obj, proto);
```

#### Syntax
```js
Object.setPrototypeOf(obj, prototype);
```

#### Parameters
* obj - The object which is to have its prototype set.
* prototype - The object's new prototype (an object or null).

### Description
Throws a TypeError exception if the object whose [[Prototype]] is to be modified is non-extensible according to Object.isExtensible(). Does nothing if the prototype parameter isn't an object or null (i.e., number, string, boolean, or undefined). Otherwise, this method changes the [[Prototype]] of obj to the new value.

`Object.setPrototypeOf()` is in the latest ECMAScript 6 standard draft. It is generally considered the proper way to set the prototype of an object, vs. the more controversial `Object.prototype.__proto__` property.

### License
MIT

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