This package has been deprecated

Author message:

Renamed to `all-keys`.

all-property-names
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/all-property-names package

2.0.0 • Public • Published

all-property-names Build Status

Get all property names of an object including non-enumerable and inherited ones

Like Object.getOwnPropertyNames() but traverses up the prototype-chain.

Install

$ npm install --save all-property-names

Usage

const allPropertyNames = require('all-property-names');
 
Object.getOwnPropertyNames(Symbol.prototype);
/*
[
    'constructor',
    'toString',
    'valueOf'
]
*/
 
allPropertyNames(Symbol.prototype);
/*
Set {
    'constructor',
    'toString',
    'valueOf',
    'toLocaleString',
    'hasOwnProperty',
    'isPrototypeOf',
    'propertyIsEnumerable',
    '__defineGetter__',
    '__lookupGetter__',
    '__defineSetter__',
    '__lookupSetter__',
    '__proto__'
}
*/

API

allPropertyNames(input)

Returns a Set.

input

Type: Object

License

MIT © Sindre Sorhus

Package Sidebar

Install

npm i all-property-names

Weekly Downloads

1

Version

2.0.0

License

MIT

Unpacked Size

3.13 kB

Total Files

4

Last publish

Collaborators

  • sindresorhus