1.0.1 • Published 4 years ago

@webkitty/searchbox v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Text input augmented with Lexer magic✨ to support advanced search features. Searchbox supports multiple user-defined keywords (filters, variables) and also NOT operator.

Features

  • Parses user input string into a structured formula of literals.
  • Supports literal negation.
  • Supports unicode.
  • Operators are configurable.

Usage

import * as searchbox from '@webkitty/searchbox';

const inputText = 'Never take title:raisins from -author:rabbits';
const keywords = ['title', 'author'];

const formula = searchbox.parse(inputText, {keywords});

// Formula:
//  _: [Never,take,from]	// words not matching any keyword (aka fulltext)
//  title: [raisins]		// "title" keyword match
//  -author: [rabbits]		// "author" keyword match with NOT operator ("-")

Please note that only case-sensitive keyword matching is supported.

📝 License

Copyright © 2019 stuchl4n3k. This project is MIT licensed.

FOSSA Status

1.0.1

4 years ago

1.0.0

4 years ago

0.0.5

4 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago