# get-own-enumerable-keys

> Like `Object.keys()` but also includes symbols

Latest version **1.0.0** (published 2023-01-16) · MIT license · 0 weekly downloads

## Install

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

## Health

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

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2023-01-16 |
| First published | 2023-01-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=14.16 |
| Dependencies | 0 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 23 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | object, own, enumerable, keys, key, property, properties, symbol, symbols |

## Links

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

## 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.0 (latest) — 2023-01-16
- 0.0.1 — 2023-01-16

## README

# get-own-enumerable-keys

> Like [`Object.keys()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys) but also includes [symbols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol)

`Object.keys()` returns the own enumerable keys of an object except symbols (for legacy reasons). This package includes symbols too.

Use [`Reflect.ownKeys()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect/ownKeys) if you also want non-enumerable keys.

## Install

```sh
npm install get-own-enumerable-keys
```

## Usage

```js
import getOwnEnumerableKeys from 'get-own-enumerable-keys';

const symbol = Symbol('x');

const object = {
	foo: true,
	[symbol]: true,
};

Object.keys(object);
// ['foo']

getOwnEnumerableKeys(object);
//=> ['foo', Symbol('x')]
```

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