1.0.0 • Published 3 years ago

searchallkeys v1.0.0

Weekly downloads
5
License
MIT
Repository
github
Last release
3 years ago

searchAllKeys

NPM to search the given input (Array of objects) in all the keys

Installation

# using npm
npm install searchallkeys

Usage

# using require
const { searchallkeys } = require('searchallkeys');

# using import
import { searchallkeys } from 'searchallkeys';

Example

searchallkeys(inputArray, valueTosSearch, fieldsArrayToLookFor)

searchallkeys(
  [
    { apple: 5, banana: 10, mango: 15 },
    { apple: 1, banana: 5, mango: 3 },
    { apple: 100, banana: 100, mango: 5 },
  ],
  5,
  ["apple", "mango"]
);