{"_id":"logic-query-parser","_rev":"13-a27bfb6a83080fe24ae02d76bcbc3258","name":"logic-query-parser","description":"A parser for logic search string","dist-tags":{"latest":"0.0.5"},"versions":{"0.0.1":{"name":"logic-query-parser","version":"0.0.1","description":"A parser for logic search string","main":"lib/index.js","scripts":{"test":"NODE_ENV=test mocha -R spec -t 60000 test/"},"repository":{"type":"git","url":"https://github.com/AnyFetch/logic-query-parser.git"},"keywords":["logic","query","parser","search"],"devDependencies":{"mocha":"1.20.x","should":"4.0.x"},"author":{"name":"Quentin Buathier","email":"quentin.buathier@epitech.eu"},"license":"MIT","bugs":{"url":"https://github.com/AnyFetch/logic-query-parser/issues"},"homepage":"https://github.com/AnyFetch/logic-query-parser","gitHead":"c91cb6c5376c8dbb952a8b459a8f7bfea298ae61","_id":"logic-query-parser@0.0.1","_shasum":"55ced067546b773e6e1d7c2f5f4b402da01d33b6","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"quentin01","email":"quentin.buathier@epitech.eu"},"maintainers":[{"name":"quentin01","email":"quentin.buathier@epitech.eu"}],"dist":{"shasum":"55ced067546b773e6e1d7c2f5f4b402da01d33b6","tarball":"https://registry.npmjs.org/logic-query-parser/-/logic-query-parser-0.0.1.tgz","integrity":"sha512-OjaRwwXxn3uobWZRgMf5v6ch7InFxCrWAqlStjrgsSlhGvgwSmTNO0LhDfIK3YeLDwIxZe/zoPy5RiNtRDzTxg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBKRWugOMy2e5gmpSeUKIMiCsr0HtP7jCSQTjNBE7kp5AiEA9zc7HDd2/nk7u7F3ClrJU+CdTh6ZgL6OswPdAHh/e60="}]}},"0.0.2":{"name":"logic-query-parser","version":"0.0.2","description":"A parser for logic search string","main":"lib/index.js","scripts":{"test":"NODE_ENV=test mocha -R spec -t 60000 test/"},"repository":{"type":"git","url":"https://github.com/AnyFetch/logic-query-parser.git"},"keywords":["logic","query","parser","search"],"devDependencies":{"mocha":"1.20.x","should":"4.0.x"},"author":{"name":"Quentin Buathier","email":"quentin.buathier@epitech.eu"},"license":"MIT","bugs":{"url":"https://github.com/AnyFetch/logic-query-parser/issues"},"homepage":"https://github.com/AnyFetch/logic-query-parser","gitHead":"6d8511007aa3be569c9d54c72fabe001cbfc60e6","_id":"logic-query-parser@0.0.2","_shasum":"d00388e6d619ac028820853d212126c706b3f46e","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"quentin01","email":"quentin.buathier@epitech.eu"},"maintainers":[{"name":"quentin01","email":"quentin.buathier@epitech.eu"}],"dist":{"shasum":"d00388e6d619ac028820853d212126c706b3f46e","tarball":"https://registry.npmjs.org/logic-query-parser/-/logic-query-parser-0.0.2.tgz","integrity":"sha512-DGVNcVtyTB2iIiGOOvUau8Mt31/bF+DNIL7+zL/hrtlR5UYCMt/QKcPQmZUWzsOb1yBCb59owhNfip/KasLcjA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHYuKJAwTWn/BVdEk1boH34qSO1ADEimL6/8dhYNTrwfAiEA9Eu0Tqqqu3NIxhxUC4wkjq2Yq7+P7lt7TePCny1Pf+Q="}]}},"0.0.3":{"name":"logic-query-parser","version":"0.0.3","description":"A parser for logic search string","main":"lib/index.js","scripts":{"test":"NODE_ENV=test mocha -R spec -t 60000 test/"},"repository":{"type":"git","url":"https://github.com/AnyFetch/logic-query-parser.git"},"keywords":["logic","query","parser","search"],"devDependencies":{"mocha":"1.20.x","should":"4.0.x"},"author":{"name":"Quentin Buathier","email":"quentin.buathier@epitech.eu"},"license":"MIT","bugs":{"url":"https://github.com/AnyFetch/logic-query-parser/issues"},"homepage":"https://github.com/AnyFetch/logic-query-parser","gitHead":"f2b1e88aa518c1945d5ecd00773c23646c686905","_id":"logic-query-parser@0.0.3","_shasum":"464fad6f564ec098b9aded7d5c1e2ca76d9d6c5c","_from":".","_npmVersion":"2.0.2","_nodeVersion":"0.10.32","_npmUser":{"name":"quentin01","email":"quentin.buathier@epitech.eu"},"maintainers":[{"name":"quentin01","email":"quentin.buathier@epitech.eu"},{"name":"matthieu.bacconnier","email":"matthieu.bacconnier@papiel.fr"}],"dist":{"shasum":"464fad6f564ec098b9aded7d5c1e2ca76d9d6c5c","tarball":"https://registry.npmjs.org/logic-query-parser/-/logic-query-parser-0.0.3.tgz","integrity":"sha512-vAoT23V1RGT1FpvK9khU9HPPZDxaKa8HvT0kk8L9tRLfuNJ+l6WOm92ijTN4TIy41obGk2eWi2ca21nhqmSqDg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDv1FjwVy4OAp0UylYbNavlJsikHXQOuYz5S4QSafMxMgIgYiWXRyYtolSGHyxHFX03pQtguHbY1f4HE+UTbTUtktM="}]}},"0.0.4":{"name":"logic-query-parser","version":"0.0.4","description":"A parser for logic search string","main":"lib/index.js","scripts":{"test":"NODE_ENV=test mocha -R spec -t 60000 test/"},"repository":{"type":"git","url":"https://github.com/AnyFetch/logic-query-parser.git"},"keywords":["logic","query","parser","search"],"devDependencies":{"mocha":"1.20.x","should":"4.0.x"},"author":{"name":"Quentin Buathier","email":"quentin.buathier@epitech.eu"},"license":"MIT","bugs":{"url":"https://github.com/AnyFetch/logic-query-parser/issues"},"homepage":"https://github.com/AnyFetch/logic-query-parser","gitHead":"0e1e3d47a1e0265a607e6e12f3839da952d0ab7c","_id":"logic-query-parser@0.0.4","_shasum":"aefae06175226bd0ee4aad9a316973843cd0bee3","_from":".","_npmVersion":"2.0.2","_nodeVersion":"0.10.32","_npmUser":{"name":"quentin01","email":"quentin.buathier@epitech.eu"},"maintainers":[{"name":"quentin01","email":"quentin.buathier@epitech.eu"},{"name":"matthieu.bacconnier","email":"matthieu.bacconnier@papiel.fr"}],"dist":{"shasum":"aefae06175226bd0ee4aad9a316973843cd0bee3","tarball":"https://registry.npmjs.org/logic-query-parser/-/logic-query-parser-0.0.4.tgz","integrity":"sha512-PzGddjsSP8WJvVJa+6QOaCQN+2geMxAwoRHtrua4GdRBKbZTOnAVmYROAII7KOJFWvTi4qmRu0GOC4h/QcZixA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBblJzunSCOehaZQzFpt4ZZg9cZGY4TA9nLCUQ9lM30gIgcxfPzTzDvqpvDRHSLGa5x+qBiiaIRDvzFnvrTPgDMqs="}]}},"0.0.5":{"name":"logic-query-parser","version":"0.0.5","description":"A parser for logic search string","main":"lib/index.js","scripts":{"test":"NODE_ENV=test mocha -R spec -t 60000 test/"},"repository":{"type":"git","url":"https://github.com/AnyFetch/logic-query-parser.git"},"keywords":["logic","query","parser","search"],"devDependencies":{"mocha":"1.20.x","should":"4.0.x"},"author":{"name":"Quentin Buathier","email":"quentin.buathier@epitech.eu"},"license":"MIT","bugs":{"url":"https://github.com/AnyFetch/logic-query-parser/issues"},"homepage":"https://github.com/AnyFetch/logic-query-parser","gitHead":"c5022c396200512fe7df8709de669aca4da2de34","_id":"logic-query-parser@0.0.5","_shasum":"56edf7c012f594c8236fd5175079ef5da1bea93c","_from":".","_npmVersion":"2.0.2","_nodeVersion":"0.10.32","_npmUser":{"name":"quentin01","email":"quentin.buathier@epitech.eu"},"maintainers":[{"name":"quentin01","email":"quentin.buathier@epitech.eu"},{"name":"matthieu.bacconnier","email":"matthieu.bacconnier@papiel.fr"}],"dist":{"shasum":"56edf7c012f594c8236fd5175079ef5da1bea93c","tarball":"https://registry.npmjs.org/logic-query-parser/-/logic-query-parser-0.0.5.tgz","integrity":"sha512-I4CZwF+dtnBYd1pKUCTgeyvDZC0ymElwmZAs77l1ebZsFZzmUkUQtdctZtMDB84diaRlaKjEpB+g26og//+fug==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDm1KIvcIhWye9c/MwA5FzLjEp3/66T9OLQpi661Lc0YQIgV1rgifTBD4Vv5D8koH5N9FCHRtC0dN13Qr+Hye6X5q8="}]}}},"readme":"# Logic Query Parser\n> Visit http://anyfetch.com for details about AnyFetch.\n\nGenerate binary tree with a logic query string as input\n\n# How to install?\n```\nnpm install\n```\n\nCheck everything is working with `npm test`.\n\n# How to use it\n\nThis lib provides a function parser whick take an optional options object and a string parameter, then returning a binary tree.\nAs binary trees are not easy to use, this lib also provides an utility function which convert said binaryTree to a more usable query form\n\nAvalaible options are for now :\n* `spaces` : String / array containing all spaces characters. Default : \" \\n\\t\"\n* `defaultOperator` : Default operator to use between two strings. Default : 'and'\n\nAvailable operators for now : AND, OR, parens, double quote\n\n# Example\n\n\n```js\nvar parser = require('logic-query-parser');\n\nvar binaryTree = parser.parse('hello AND welcome');\n```\n\nThe binaryTree for this example will be :\n```js\n{\n  lexeme: { \n    type: 'and'\n  },\n  left: {\n    lexeme: {\n      type: 'string',\n      value: 'hello'\n    },\n    left: null,\n    right: null\n  },\n  right: {\n    lexeme: {\n      type: 'string',\n      value: 'welcome'\n    },\n    left: null,\n    right: null\n  }\n}\n```\n\nAnother example, slightly more complex:\n\n```js\nvar parser = require('logic-query-parser');\n\nvar binaryTree = parser.parse('(welcome OR bye) AND (hello OR ahoy)');\n```\n\nAnd the binary tree :\n```js\n{\n  lexeme: {\n    type: \"and\"\n  },\n  left: {\n    lexeme: {\n      type: \"or\"\n    },\n    left: {\n      lexeme: {\n        type: \"string\",\n        value: \"welcome\"\n      },\n      left: null,\n      right: null\n    },\n    right: {\n      lexeme: {\n        type: \"string\",\n        value: \"bye\"\n      },\n      left: null,\n      right: null\n    }\n  },\n  right: {\n    lexeme: {\n      type: \"or\"\n    },\n    left: {\n      lexeme: {\n        type: \"string\",\n        value: \"hello\"\n      },\n      left: null,\n      right: null\n    },\n    right: {\n      lexeme: {\n        type: \"string\",\n        value: \"ahoy\"\n      },\n      left: null,\n      right: null\n    }\n  }\n}\n```\n\nAs said before, trees are useful but not easy to use. You can also get the \"query form\":\n\n```js\nvar parser = require('logic-query-parser');\n\nvar binaryTree = parser.parse('(welcome OR bye) AND (hello OR ahoy)');\nvar query = parser.utils.binaryTreeToQueryJson(binaryTree);\n```\n\nReturning:\n```js\n{\n  type: \"and\",\n  values: [\n    {\n      type: \"or\",\n      values: [\n        {\n          type: \"string\",\n          value: \"welcome\"\n        },\n        {\n          type: \"string\",\n          value: \"bye\"\n        }\n      ]\n    },\n    {\n      type: \"or\",\n      values: [\n        {\n          type: \"string\",\n          value: \"hello\"\n        },\n        {\n          type: \"string\",\n          value: \"ahoy\"\n        }\n      ]\n    }\n  ]\n}\n```\n\n\nTake a look at `config/tests.js` for more samples\n\nSupport: `support@anyfetch.com`.\n","maintainers":[{"name":"quentin01","email":"quentin.buathier@epitech.eu"},{"name":"matthieu.bacconnier","email":"matthieu.bacconnier@papiel.fr"}],"time":{"modified":"2022-06-19T13:54:20.849Z","created":"2014-09-19T11:35:10.752Z","0.0.1":"2014-09-19T11:35:10.752Z","0.0.2":"2014-09-19T12:59:28.333Z","0.0.3":"2014-10-06T14:11:26.392Z","0.0.4":"2014-11-12T19:31:10.647Z","0.0.5":"2014-12-15T13:26:56.768Z"},"homepage":"https://github.com/AnyFetch/logic-query-parser","keywords":["logic","query","parser","search"],"repository":{"type":"git","url":"https://github.com/AnyFetch/logic-query-parser.git"},"author":{"name":"Quentin Buathier","email":"quentin.buathier@epitech.eu"},"bugs":{"url":"https://github.com/AnyFetch/logic-query-parser/issues"},"license":"MIT","readmeFilename":"README.md"}