js-search-array
js-search-array is a small library to search a striing in an array of objects or strings.
Installation
Installation through npm
$ npm install js-search-array
Usage
; // Find string in an array of strings let stringArray = 'Delhi' 'Tamil Nadu' 'Karnataka' 'Uttar Pradesh' ; // => ['Tamil Nadu', 'Karnataka', 'Uttar Pradesh'] // Find string in an array of objects with the key name to match with let objectArray = name: 'Delhi' number: 1 name: 'Uttarkhand' number: 2 name: 'Himachal Pradesh' number: 3 name: 'Rajasthan' number: 4 ; // => [{name: 'Delhi', number: 1}. {name: 'Himachal Pradesh', number: 3}]
Licence
MIT