logical-parser

logical parser in JavaScript

Usage no npm install needed!

<script type="module">
  import logicalParser from 'https://cdn.skypack.dev/logical-parser';
</script>

README

LogicalParser

logical parser in JavaScript

Usage

npm install logical-parser
const parse = require('logical-parser')
parse('1 AND 2 OR 3')

// => { type: 'operator',
//      left:
//       { type: 'operator',
//         left: { type: 'value', value: '1' },
//         right: { type: 'value', value: '2' },
//         operator: 'AND' },
//      right: { type: 'value', value: '3' },
//      operator: 'OR' }