docs/README.md
Lightweight fuzzy-search library, with zero dependencies.
<Sponsors />import Fuse from 'fuse.js'
const books = [
{ title: "Old Man's War", author: 'John Scalzi' },
{ title: 'The Lock Artist', author: 'Steve Hamilton' },
{ title: 'JavaScript Patterns', author: 'Stoyan Stefanov' }
]
const fuse = new Fuse(books, {
keys: ['title', 'author'],
includeScore: true
})
fuse.search('jon')
// [{ item: { title: "Old Man's War", author: "John Scalzi" }, refIndex: 0, score: 0.25 }]
fuse.search('patterns')
// [{ item: { title: "JavaScript Patterns", ... }, refIndex: 2, score: 0.0 }]
$and / $or expressions for structured queriestitle over descriptiongetFnnpm install fuse.js
See Getting Started for installation options, builds, and imports.
<Donate />