psq

parses search query string into json

npm install psq
12 downloads in the last month

psq

psq (parse search query) converts a search query into JSON

build status

Requirements

Install

  • npm install psq

Example

var psq = require('psq')

console.log(psq('"hello world" -python +example'))
{
    "exclude": {
        "labels": {},
        "words": [
            "python"
        ]
    },
    "include": {
        "labels": {},
        "words": [
            "hello world",
            "example"
        ]
    }
}
`

Author

TODO

  • Documentation
  • Add flags for HTML escaping/stripping and URL encoding/decoding

CHANGELOG

0.0.3

  • Added support for terms when they contain a dash
  • Words inside quotes will now have quotes stripped in results

0.0.2

  • Fixed return object (now returns JSON)
  • Added example

0.0.1

  • Initial Release

LICENSE

  • MIT
npm loves you