{"id":17238024,"url":"https://github.com/jsantell/text-query","last_synced_at":"2025-03-26T02:16:06.366Z","repository":{"id":24895614,"uuid":"28311978","full_name":"jsantell/text-query","owner":"jsantell","description":"Generate simple boolean text queries","archived":false,"fork":false,"pushed_at":"2014-12-21T21:47:56.000Z","size":120,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T12:14:16.360Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/jsantell.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":"2014-12-21T20:24:50.000Z","updated_at":"2014-12-23T04:08:14.000Z","dependencies_parsed_at":"2022-08-22T20:11:24.432Z","dependency_job_id":null,"html_url":"https://github.com/jsantell/text-query","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsantell%2Ftext-query","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsantell%2Ftext-query/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsantell%2Ftext-query/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsantell%2Ftext-query/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsantell","download_url":"https://codeload.github.com/jsantell/text-query/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245573893,"owners_count":20637674,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-15T05:44:25.547Z","updated_at":"2025-03-26T02:16:06.347Z","avatar_url":"https://github.com/jsantell.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# text-query\n\n[![Build Status](http://img.shields.io/travis/jsantell/text-query.svg?style=flat-square)](https://travis-ci.org/jsantell/text-query)\n[![Build Status](http://img.shields.io/npm/v/text-query.svg?style=flat-square)](https://www.npmjs.org/package/text-query)\n\nSimple query tokenizer for turning a query string into a comparator for other text fields.\n\n## Usage\n\n```js\nvar Query = require(\"text-query\");\n\n// Create a query: spaces are OR'd groups and commas AND groups, with\n// double quoted strings being one search entity.\nvar q = new Query(\"'death metal', swedish finnish, guitar bass drums\");\n\n// This query only returns true of \"death metal\" is in the text,\n// along with \"swedish\" OR \"finnish\", and an instrument (\"guitar\" or \"bass\" or \"drums\")\n// must also be in the string.\nq.matches(\"swedish death metal for guitarists\"); // true\nq.matches(\"death metal for finnish bassists\"); // true\nq.matches(\"death to swedish metal drums\"); // false, 'death metal' is not a single string\nq.matches(\"norwegian death metal for guitarists\"); // false, missing 'swedish' or 'finnish'\n\n// Can also handle arrays of strings for matching\nq.matches([\"death metal\", \"swedish\", \"guitar\"]); // true\n```\n\n## Installation\n\n`$ npm install text-query`\n\n## API\n\n### new Query(query)\n\nCreates a new Query object with `query` string.\n\n### query.matches(text)\n\nReturns a boolean indicating whether or not `text` matches the internal `query`. `text` can also be an array of strings.\n\n## Testing\n\n`npm test`\n\n## License\n\nMIT License, Copyright (c) 2014 Jordan Santell\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsantell%2Ftext-query","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsantell%2Ftext-query","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsantell%2Ftext-query/lists"}