A tiny library to perform search on JavaScript objects.
$ npm install searchx --save
$ yarn add searchx
// Load the build.
var { search } = require('searchx');
// keyword: string - "A keyword to look for in a collection"
// collection: Array<object> - "An array of objects to perform search on"
// options = {
// columns: ['col1', 'col2', 'col3'], // attributes to perform search on. (null by default)
// };
// This will return a promise.
var promise = search(keyword, collection, options);
// Resolving the promise would return the search results.
return promise.then(result => result);
$ npm run test
$ yarn test
Tested in Chrome, Firefox, Edge & IE.
This project is licensed under the MIT License - see the LICENSE.md file for details