# own-keys

> Robustly get an object's own property keys (strings and symbols), including non-enumerables when possible

Latest version **1.0.2** (published 2026-07-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install own-keys
pnpm add own-keys
yarn add own-keys
bun add own-keys
```

## Health

**Score 65/100 (B)** — status: active.

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2026-07-21 |
| First published | 2024-12-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 0.4 |
| Dependencies | 4 |
| Unpacked size | 12.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jordan Harband |
| Maintainers | ljharb |
| Keywords | own, key, keys, propertykey, string, symbol, enumerable, non-enumerable, robust |

## Links

- npm: https://www.npmjs.com/package/own-keys
- Repository: https://github.com/ljharb/own-keys
- Homepage: https://github.com/ljharb/own-keys#readme
- Issues: https://github.com/ljharb/own-keys/issues
- Funding: https://github.com/sponsors/ljharb
- npm.io page: https://npm.io/package/own-keys

## Dependencies (4)

- [call-bound](https://npm.io/package/call-bound.md) ^1.0.4
- [object-keys](https://npm.io/package/object-keys.md) ^1.1.1
- [get-intrinsic](https://npm.io/package/get-intrinsic.md) ^1.3.0
- [safe-push-apply](https://npm.io/package/safe-push-apply.md) ^1.0.0

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2026-07-21
- 1.0.1 — 2024-12-29
- 1.0.0 — 2024-12-29

## README

# own-keys <sup>[![Version Badge][npm-version-svg]][package-url]</sup>

[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]

[![npm badge][npm-badge-png]][package-url]

Robustly get an object's own property keys (strings and symbols), including non-enumerables when possible.

## Getting started

```sh
npm install --save own-keys
```

## Usage/Examples

```js
var ownKeys = require('own-keys');
var assert = require('assert');

assert.deepEqual(ownKeys({ a: 1, b: 2 }), ['a', 'b']);
assert.deepEqual(ownKeys([1, 2, 3]), [0, 1, 2, 'length']);
```

## Tests
Simply clone the repo, `npm install`, and run `npm test`

[package-url]: https://npmjs.org/package/own-keys
[npm-version-svg]: https://versionbadg.es/ljharb/own-keys.svg
[deps-svg]: https://david-dm.org/ljharb/own-keys.svg
[deps-url]: https://david-dm.org/ljharb/own-keys
[dev-deps-svg]: https://david-dm.org/ljharb/own-keys/dev-status.svg
[dev-deps-url]: https://david-dm.org/ljharb/own-keys#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/own-keys.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/own-keys.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/own-keys.svg
[downloads-url]: https://npm-stat.com/charts.html?package=own-keys
[codecov-image]: https://codecov.io/gh/ljharb/own-keys/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/ljharb/own-keys/
[actions-image]: https://img.shields.io/github/check-runs/ljharb/own-keys/main
[actions-url]: https://github.com/ljharb/own-keys/actions

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