Search Query Syntax Parser
JSON →The `search-query-parser` library provides a robust, dependency-free solution for parsing advanced search query strings into a structured JavaScript object. It supports syntax similar to popular search engines, allowing for field-specific searches (e.g., `from:user`, `subject:topic`), date ranges (`date:1/10/2013-15/04/2014`), multi-value fields, and exclusion syntax (`-keyword:value`). The current stable version is 1.6.0, released over five years ago, indicating a mature and stable, but not actively developed, state. Key features include configurable keywords and range fields, optional tokenization of free text, the ability to always return matched keyword values as arrays, and the inclusion of character offsets for parsed elements. Since version 1.6.0, it also offers a `stringify` method to convert the parsed object back into a query string. This package primarily targets CommonJS environments, relying on the `require` syntax.
Traffic · last 30 days ↓100% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇩🇪 Germany · 🇫🇷 France