# search-property

> Simple package that finds any property on an object.

Latest version **1.0.2** (published 2022-03-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install search-property
pnpm add search-property
yarn add search-property
bun add search-property
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-03-17 |
| First published | 2022-03-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Yoeri Moens |
| Maintainers | miljoen |
| Keywords | typescript, ts, npm, package |

## Links

- npm: https://www.npmjs.com/package/search-property
- Repository: https://github.com/Miljoen/search-property
- Homepage: https://github.com/Miljoen/search-property#readme
- Issues: https://github.com/Miljoen/search-property/issues
- npm.io page: https://npm.io/package/search-property

## Alternatives

- [csv-to-markdown-table](https://npm.io/package/csv-to-markdown-table.md) — 47.0K weekly downloads
- [@sapphire/ratelimits](https://npm.io/package/@sapphire/ratelimits.md) — 4.4K weekly downloads
- [js-csvparser](https://npm.io/package/js-csvparser.md) — 2.0K weekly downloads
- [@adadapted/js-sdk](https://npm.io/package/@adadapted/js-sdk.md) — 251 weekly downloads
- [@grapecity/spread-sheets-sparklines](https://npm.io/package/@grapecity/spread-sheets-sparklines.md) — 103 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2022-03-17
- 1.0.1 — 2022-03-17
- 1.0.0 — 2022-03-17

## README

# Search Property [![npm version](https://badgen.net/npm/v/search-property?label=npm%20package&color=green&cache=600)][npm]

Simple package that finds any property on an object.

`searchProperty()` does a nested search, so you don't have to implement any custom code for deep searches.

## Technology

![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white)
![JavaScript](https://img.shields.io/badge/javascript-%23323330.svg?style=for-the-badge&logo=javascript&logoColor=%23F7DF1E)

## Quick links

- Consult [CHANGELOG.md][changelog] for the project history.
- View [package repository][project] on GitHub.

## Installation

```
npm install search-property
```

## Examples

```typescript
import { searchProperty, searchPropertyAll, searchProperties, searchPropertiesAll } from 'search-property'

const myObject = {
    id: 1,
    name: 'someName',
    nestedObject: {
        id: 2,
        colour: 'red',
        anotherNest: {
            id: 3,
            name: 'anotherName',
            speed: '50 km/h'
        }
    }
}

searchProperty('id', myObject)      // 1
searchProperty('speed', myObject)   // '50 km/h'

searchPropertyAll('id', myObject)   // [1, 2, 3]
searchPropertyAll('name', myObject) // ['someName', 'anotherName']

searchProperties(['id', 'speed'], myObject)    // [1, '50 km/h']

searchPropertiesAll(['id', 'speed'], myObject) // [[ 1, 2, 3], ['50 km/h']]
```

## Contributors

View the full list of [contributors].

[npm]: https://www.npmjs.com/package/search-property

[changelog]: https://github.com/Miljoen/search-property/blob/master/CHANGELOG.md

[project]: https://github.com/Miljoen/search-property

[contributors]: https://github.com/Miljoen/search-property/graphs/contributors

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