xpath-analyzer

An analyzer / parser for XPath 1.0 expressions.

Usage no npm install needed!

<script type="module">
  import xpathAnalyzer from 'https://cdn.skypack.dev/xpath-analyzer';
</script>

README

xpath-analyzer

Build Status Code Climate Test Coverage

An analyzer / parser for XPath 1.0 expressions.

Installation

The package can be installed with npm.

$ npm install xpath-analyzer

Usage (ES modules)

import XPathAnalyzer from "xpath-analyzer";

let analyzer = new XPathAnalyzer("1 + 1");

analyzer.parse();

// { type: 'additive',
//   lhs: { type: 'number', number: 1 },
//   rhs: { type: 'number', number: 1 } }

Usage (CommonJS)

var XPathAnalyzer = require("xpath-analyzer").default;

var analyzer = new XPathAnalyzer("1 + 1");

analyzer.parse();

// { type: 'additive',
//   lhs: { type: 'number', number: 1 },
//   rhs: { type: 'number', number: 1 } }