search-plus-ts
Version:
Search always with machs and highlights.
78 lines (62 loc) โข 2.01 kB
Markdown
# ๐ Search-Plus-Ts
### Search always with machs and highlights.
`search-plus-ts` is server and client side searching library. and with text highlighting and marking.
# ๐ Documentation
Full Guide and Examples With server and client react - [๐ฉโ๐ป With sever and react client ](https://github.com/devgauravjatt/search-plus-ts/tree/examples/with-server-and-client)
Full Guide and Examples With client react hook - [๐ฉโ๐ป Vite react client](https://github.com/devgauravjatt/search-plus-ts/tree/examples/vite-react-client)
๐งจ More examples - [๐ฉโ๐ป More Examples ](https://github.com/devgauravjatt/search-plus-ts/tree/examples)
## ๐ Features
- Search always with machs
- Highlighting and Marking
- Work with any framework
- Server and Client side searching
- Easy to use
## โจ Quick Start Code
```ts
// 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",
}
]
```