{"id":16845750,"url":"https://github.com/othree/simple-search-query","last_synced_at":"2026-03-09T11:32:08.285Z","repository":{"id":57360855,"uuid":"127494508","full_name":"othree/simple-search-query","owner":"othree","description":"Simple logic search query matcher","archived":false,"fork":false,"pushed_at":"2018-04-17T04:03:18.000Z","size":27,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-09T16:07:50.742Z","etag":null,"topics":["parse","peg","query","search"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/simple-search-query","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/othree.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-31T03:12:21.000Z","updated_at":"2018-04-17T04:03:20.000Z","dependencies_parsed_at":"2022-09-06T22:21:26.657Z","dependency_job_id":null,"html_url":"https://github.com/othree/simple-search-query","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/othree/simple-search-query","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/othree%2Fsimple-search-query","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/othree%2Fsimple-search-query/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/othree%2Fsimple-search-query/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/othree%2Fsimple-search-query/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/othree","download_url":"https://codeload.github.com/othree/simple-search-query/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/othree%2Fsimple-search-query/sbom","scorecard":{"id":714289,"data":{"date":"2025-08-11","repo":{"name":"github.com/othree/simple-search-query","commit":"b6d07e7fb4c541c14e7d0ce225b58383644d11d5"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.4,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/24 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T09:06:50.515Z","repository_id":57360855,"created_at":"2025-08-22T09:06:50.515Z","updated_at":"2025-08-22T09:06:50.515Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30292411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T11:12:22.024Z","status":"ssl_error","status_checked_at":"2026-03-09T11:10:54.577Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["parse","peg","query","search"],"created_at":"2024-10-13T12:59:56.592Z","updated_at":"2026-03-09T11:32:08.256Z","avatar_url":"https://github.com/othree.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# simple-search-query\n\nSimple logic search query matcher. Execute query like:\n\n* `XML and HTML` Looking for both keywords *XML* and *HTML*.\n* `English and (not GB)` Looking for *English* and no *GB* present.\n\n## Why\n\nThis is a simple practice to know how to use [PEG.js][]. And my target is to build a logical query can help people filter data. Using common syntax people can easily understand or already known.\n\n## Usage\n\n```js\nimport query from 'simple-search-query';\n\nconst q = query('XML or HTML or \"Foo Bar\"');\n\nq('XML/HTML'); // true\nq('XSLT'); // false\nq('XHTML'); // false, default matcher use word boundary\n```\n\n## Reference\n\n### function `query`\n\nDefault export from **simple-search-query**.\n\n#### syntax\n\n```js\nquery(query_string)\nquery(query_string, options)\n```\n\nReturn a `q` function can be used to search by the given query_string.\n\n#### parameters\n\n*   `query_string`: The logic query string from the user or other input.\n*   `options`: Optional default options object.\n\n### function `q`\n\n#### syntax\n\n```js\nq(text);\nq(text, options);\n\n```\n\n#### parameters\n\n*   `text`: Text to search.  \n*   `options`: Optional options object.\n\n### Options Object\n\n*   `i`: Ignore case, default `true`.  \n*   `matcher`: Matcher function, default matcher function use regexp and word boundary like:\n\n    ```js\n    () =\u003e !!(new RegExp(`\\\\b${query}\\\\b`)).test(entry)\n    ```\n   \n    There are two more built-in matcher functions:\n    \n    `has`: Not care about word boundary, use `indexOf`. Since CJK characters do not work well with word boundary. `has` might be a good choice to search them.  \n    `eqeq`: Full match, use `===`.\n\n    If you want to assign the default matcher in options, use `default`.\n   \n    It's also possible to send custom matcher function, and the function will receive following arguments in order:\n\n    1.  `entry`: Text to search.\n    2.  `query`: The item from parse query string. For example: `XML or HTML or \"Foo Bar\"`. The matcher function will be called three times\n        with different query argument. One is `XML`, second is `HTML`. The last one is `Foo Bar`.\n        \n    3.  `options`: Options object.\n\n    Custom matcher function needs to handle ignore case setting in options object itself.\n    The custom matcher function should return a boolean value, then q function will handle the rest (logic part of the query string).\n\n\n## Query String Syntax\n\nSupports logic:\n\n* `and`, `\u0026` infix\n* `or`, `|` infix\n* `not`, `!` prefix\n\nSupports subquery, use `()` to wrap subexpression.\n\nSupports quoted string, both double and single quoted string.\n\n[PEG.js]:https://pegjs.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fothree%2Fsimple-search-query","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fothree%2Fsimple-search-query","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fothree%2Fsimple-search-query/lists"}