1.1.8 • Published 8 months ago
recipe-search-parser v1.1.8
Installation
npm install recipe-search-parser
yarn add recipe-search-parser
Usage
import SearchParser from "recipe-search-parser";
const searchParser = new SearchParser();
Stringify
searchParser.stringify({ query, category, include, exclude })
// Return: cake-with-cholocate-categoria-sweet-con-sugar-flour-senza-salt
### Parse
<p>The <code>searchParser.parse(data)</code> takes one parameter <code>URL</code>. The string is then parsed and formatted into query, category, include and exclude. </p>
```javascript
const URL = "cake-with-cholocate-categoria-sweet-con-sugar-flour-senza-salt"
searchParser.parse(URL)
// Return: {
// query: "cake with chocolate",
// category: "sweet",
// include: ["sugar", "flour"],
// exclude: ["salt"]
Contribute
You are welcome to contribute!