# libj-object-search

> This is used to search in objects' properties

Latest version **1.1.0** (published 2019-08-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install libj-object-search
pnpm add libj-object-search
yarn add libj-object-search
bun add libj-object-search
```

## 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.1.0 |
| Published | 2019-08-15 |
| First published | 2019-08-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 418 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | saeidfarahi |

## Links

- npm: https://www.npmjs.com/package/libj-object-search
- Repository: https://saeidfarahi@dev.azure.com/saeidfarahi/libj-object-search/_git/libj-object-search
- npm.io page: https://npm.io/package/libj-object-search

## Dependencies (1)

- [core-js](https://npm.io/package/core-js.md) ^3.2.1

## Recent versions

- 1.1.0 (latest) — 2019-08-15
- 1.0.1 — 2019-08-10

## README

# libj-object-search
### Part of libj tools

This is used to search in objects' properties

## Usage (npm)
```
npm install libj-object-search
```
```
import { searchObjects } from 'libj-object-search'
```
```
var list = [
    { name: 'ali', family: 'farahi' },
    { name: 'monir', family: 'marahi' },
    { name: 'hasan', family: 'farahmanesh' },
]

it('all properties', function () {
    var res = searchObjects('arahi', list)
    assert.deepEqual(res, [
        { name: 'ali', family: 'farahi' },
        { name: 'monir', family: 'marahi' },
    ])
})

it('name with no results : arahi', function () {
    var res = searchObjects('arahi', list, ['name'])
    assert.deepEqual(res, [])
})

it('family: arahi', function () {
    var res = searchObjects('arahi', list, ['family'])
    assert.deepEqual(res, [
        { name: 'ali', family: 'farahi' },
        { name: 'monir', family: 'marahi' },
    ])
})

it('family : farah', function () {
    var res = searchObjects('farah', list, ['family'])
    assert.deepEqual(res, [
        { name: 'ali', family: 'farahi' },
        { name: 'hasan', family: 'farahmanesh' },
    ])
})
```

## Test
- Run this in a separate command line to start node server
```
node server.js
```
- Run one of the following to re-create bundles
```
npm test
npm run dev
npm run dev:watch
```
- Navigate to http://localhost:3000

## Build
```
npm run build
npm run build:watch
```

## Make sure to test everything in all browsers (specially IE 10/11)

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