own-keys <sup>Version Badge</sup>

github actions coverage License Downloads

npm badge

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

Getting started

npm install --save own-keys

Usage/Examples

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

own-keys - Installation

To install own-keys via this registry, you'll need to install via the --registry parameter with your package manager.

n

NPM

npm install own-keys --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Yarn

yarn config set registry https://js.registry.sudovanilla.org
yarn install own-keys

Learn more about the config option.

PNPM

pnpm install own-keys --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Bun Logo

Bun

bun install own-keys --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Learn more about setting this up in your bunfig.toml configuration.


For Deno, add the following to your .npmrc file in your directory:

registry="https://js.registry.sudovanilla.org"

Then run the deno install command.

own-keys - Download

Download Tarball (v1.0.1)

Integrity sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==
SHASUM e4006910a2bf913585289676eebd6f390cf51358
Tarball https://js.registry.sudovanilla.org/own-keys/-/own-keys-1.0.1.tgz