search-plus-ts
is server and client side searching library. and with text highlighting and marking.
Full Guide and Examples With server and client react - ๐ฉโ๐ป With sever and react client
Full Guide and Examples With client react hook - ๐ฉโ๐ป Vite react client
๐งจ More examples - ๐ฉโ๐ป More Examples
// npm install search-plus-ts is required
import searchPlusTs from 'search-plus-ts'
const quotes = [
{
id: 1,
quote:
'Your heart is the size of an ocean. Go find yourself in its hidden depths.',
author: 'Rumi',
},
{
id: 2,
quote:
'The Bay of Bengal is hit frequently by cyclones. The months of November and May, in particular, are dangerous in this regard.',
author: 'Abdul Kalam',
},
{
id: 3,
quote:
'Thinking is the capital, Enterprise is the way, Hard Work is the solution.',
author: 'Abdul Kalam',
},
{
id: 4,
quote: "If You Can'T Make It Good, At Least Make It Look Good.",
author: 'Bill Gates',
},
{
id: 5,
quote:
"Heart be brave. If you cannot be brave, just go. Love's glory is not a small thing.",
author: 'Rumi',
},
]
const SearchPlus = new searchPlusTs({
data: quotes,
keys: ['quote', 'author'],
})
const results = SearchPlus.search('heart yourself rumi')
console.log('๐ results :-', results)
๐ results :- [
{
id: 1,
quote: "Your heart is the size of an ocean. Go find yourself in its hidden depths.",
author: "Rumi",
}
]