query-monster

0.1.6 • Public • Published

query-monster

Build Status

A simple tool for building search queries for Javascript on the client or server side.

Returns an object containing terms, filtered for stopwords, and an array of exact phrases from single or double quotes.

Installing

npm i --save query-monster

In Browser

<script src="../dist/query-monster.js"></script>
<script>
  var monsta = queryMonster;
</script>

In Node

var monsta = require('query-monster');

Usage

 
var result = monsta.crush('new habanero pizza at "pizza hut"');
 

Result

{
  "query": "new habanero pizza at \"pizza hut\"",
  "phrases": [
    "pizza hut"
  ],
  "terms": [
    "habanero",
    "pizza"
  ]
}

Dependencies

lodash for _.reject

Readme

Keywords

Package Sidebar

Install

npm i query-monster

Weekly Downloads

8

Version

0.1.6

License

ISC

Last publish

Collaborators

  • rudeluv