Socket
Book a DemoInstallSign in
Socket

search-queries

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

search-queries

Simple and powerful parser for advanced search queries

latest
Source
npmnpm
Version
0.3.0
Version published
Weekly downloads
17
Maintainers
0
Weekly downloads
 
Created
Source

Simple and powerful parser for advanced search queries like GitHub search queries.

Usage

import { QueryParser } from 'search-queries';

const parser = new QueryParser({ modifiers: ['!', '-'] });

const query = parser.parse(
  `fancy words label:foo -label:bar and "multiple words string" -"excluded phrase"`
);

// Yield object equal to
expect(query).toEqual([
  { value: 'fancy' },
  { value: 'words' },
  { keyword: 'label', value: 'foo' },
  { keyword: 'label', value: 'bar', modifier: '-' },
  { value: 'and' },
  { value: 'multiple words string' },
  { value: 'excluded phrase', modifier: '-' },
]);

API

TODO: add docs

Development

search-queries is an truth open source project, so you are welcome on project github repository to contribute a code, make issues with feature requests and bug reports.

You may contribute to a project if you tell about search-queries to your friends.

Keywords

search syntax parser

FAQs

Package last updated on 03 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts