1
0

Add additional use cases to README.

This commit is contained in:
William Horton
2016-02-29 01:04:52 -05:00
parent 4904d97ff6
commit d00df3be5c

View File

@@ -53,6 +53,20 @@ It accepts 2 values:
Both values take an array of strings, as in the example just above.
If no keywords or ranges are specified, or if none are present in the given search query, then `searchQuery.parse` will return a string.
```javascript
var searchQuery = require('search-query-parser');
var query = 'a query with just text';
var parsedQuery = searchQuery.parse(query);
// parsedQuery is now 'a query with just text'
var options = {keywords: ['unused']};
var parsedQueryWithOptions = searchQuery.parse(query, options);
// parsedQueryWithOptions is now 'a query with just text'
```
## Testing
The 17 tests are written using the BDD testing framework should.js, and run with mocha.