# get-props

> gets exactly those property names that you need

Latest version **1.0.2** (published 2018-08-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install get-props
pnpm add get-props
yarn add get-props
bun add get-props
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2018-08-19 |
| First published | 2017-10-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 0 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | astur |
| Maintainers | astur |
| Keywords | object, properties |

## Links

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

## Recent versions

- 1.0.2 (latest) — 2018-08-19
- 1.0.1 — 2018-06-06
- 1.0.0 — 2017-10-29
- 0.0.1 — 2017-10-16

## README

# get-props

gets exactly those property names that you need

[![Build Status][travis-image]][travis-url]
[![NPM version][npm-image]][npm-url]

## Install

```bash
npm i get-props
```

## Usage

```js
const getProps = require('get-props');

getProps(obj, options);
```

**obj** - object whose properties you want to receive

**options** - object with following fields:

* **enums** (Boolean, default: `true`) - if `false` only enumerable properties of `obj` will found.

* **protos** (Boolean, default: `false`) - if `true` properties of objects (but not classes) in prototype chain of `obj` will found too.

* **symbols** (Boolean, default: `false`) - if `true` properties of `obj` with symbol key will found too.

Returns array of property names.

## Example

```js
const s = Symbol();
const o1 = {};
o1[s] = 1;

const o2 = {};
Reflect.defineProperty(o2, 'notEnum', {enumerable: false, value: 1});

const F = function(){this.field = 1};
F.prototype.staticField = 1;
const o3 = new F();

Reflect.setPrototypeOf(o1, o2);
Reflect.setPrototypeOf(o2, o3);

console.log(getProps(o1, {protos: true, symbols: true}));
//[Symbol(""), "notEnum", "field"]

console.log(getProps(o1, {enums: false}));
//[]
```

## License

MIT

[npm-url]: https://npmjs.org/package/get-props
[npm-image]: https://badge.fury.io/js/get-props.svg
[travis-url]: https://travis-ci.org/astur/get-props
[travis-image]: https://travis-ci.org/astur/get-props.svg?branch=master

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