# get-proto-x

> Robustly get the [[Prototype]] of an object

Latest version **1.0.0** (published 2026-01-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install get-proto-x
pnpm add get-proto-x
yarn add get-proto-x
bun add get-proto-x
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2026-01-13 |
| First published | 2026-01-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 4.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | me |
| Maintainers | xsfj |

## Links

- npm: https://www.npmjs.com/package/get-proto-x
- Repository: https://github.com/xsfj/get-proto-x
- Homepage: https://github.com/xsfj/get-proto-x#readme
- Issues: https://github.com/xsfj/get-proto-x/issues
- npm.io page: https://npm.io/package/get-proto-x

## Dependencies (4)

- [dunder-proto-x](https://npm.io/package/dunder-proto-x.md) ^1.0.0
- [es-error-intrinsics](https://npm.io/package/es-error-intrinsics.md) ^1.0.1
- [object.getprototypeof-x](https://npm.io/package/object.getprototypeof-x.md) ^1.0.0
- [reflect.getprototypeof-x](https://npm.io/package/reflect.getprototypeof-x.md) ^1.0.0

## Recent versions

- 1.0.0 (latest) — 2026-01-13

## README

# get-proto

Robustly get the [[Prototype]] of an object. Uses the best available method.

## Getting started

```sh
npm install --save get-proto
```

## Usage

```js
const assert = require("assert")
const getProto = require("get-proto")

const a = { a: 1, b: 2, [Symbol.toStringTag]: "foo" }
const b = { c: 3, __proto__: a }

assert.equal(getProto(b), a)
assert.equal(getProto(a), Object.prototype)
assert.equal(getProto({ __proto__: null }), null)
```

## Tests

Clone the repo, `npm install`, and run `npm test`

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