1.0.2 • Published 11 days ago

search-terms v1.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
11 days ago

Actions Status

search-terms

Get search terms separated by spaces from a search query. Negative terms have a dash(-) in front. Terms can have spaces or a dash at the beginning if quoted.

Example

const searchTerms = require("search-terms");

//  positive terms ---------⏷--------⏷------------------⏷
console.log(searchTerms("this-is 'a string' -'-with' '-positive' -'and negative' -terms"));
//  negative terms -----------------------------⏶-----------------------⏶---------⏶

/*
 * Result:
 *
 * {
 *   "positive":  [
 *     "this-is",
 *     "a string",
 *     "-positive",
 *   ],
 *   "negative":  [
 *     "-with",
 *     "and negative",
 *     "terms"
 *   ]
 * }
 */
1.0.2

11 days ago

1.0.1

11 days ago

1.0.0

4 years ago

0.2.0

5 years ago

0.1.0

6 years ago