deep-level-searching

1.0.20 • Public • Published

Logo

Deep-Searching

Searching by 'keyword' deep in a nested array or nested object.

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Example

About The Project

This project is simple javascript code for deep searching i.e., when input (array or object) is nested then it search for all the elements that matches the keyword and returns filtered data.

Getting Started

Prerequisites

This is basic js code can be implemented in frontend or backend.

Installation

Install NPM packages

 npm i deep-level-searching

Usage

1- import 'deep-level-searching'

import {deepSearch} from 'deep-level-searching';

2- Input

  • keyword -> search string
  • nested array -> array in which we have to perform searching
  • excludedKeys -> array of keys on which user does not want to perform searching
let filteredData = deepSearch(keyword,nestedArray,{excluded:excludedKeys});

Example

import {deepSearch} from 'deep-level-searching';
const keyword = 'john';
const nestedArray = [{}]
const excludedKeys = []
let filteredData = deepSearch(keyword,nestedArray,{excluded:excludedKeys});

Package Sidebar

Install

npm i deep-level-searching

Weekly Downloads

23

Version

1.0.20

License

ISC

Unpacked Size

223 kB

Total Files

5

Last publish

Collaborators

  • chhavi.kohli