xpath-to-css-template-string-tag

Convert XPath to Selector as Tagged template literal

Usage no npm install needed!

<script type="module">
  import xpathToCssTemplateStringTag from 'https://cdn.skypack.dev/xpath-to-css-template-string-tag';
</script>

README

xpath-to-css-template-string-tag

npm version downloads count travis dependencies

:ledger: Convert XPath to Selector as Tagged template literal

Installation

npm install xpath-to-css-template-string-tag

Usage

const { x } = require('xpath-to-css-template-string-tag');
x`//div[@id="foo"]` // 'div#foo'

Unit tests

Use Jasmine to setup unit test:

npm test

Code coverage

Check code coverage with Istanbul:

npm run coverage

License

The MIT License @ 2018