jixen is a pre-processor for JavaScript which converts inline HTML expressions into actual JavaScript code which when executed will return the HTML element using the DOM API.
Install dependencies using pip
pip install -r requirements.txt
Run jixen on your code
python jixen in.js out.js
Input:
const v = `<button onclick={console.log('Hello')}>"Hello"</button>`
document.body.append(v)
Output:
const v = (() => {
let e = document.createElement('button')
e.append('Hello')
e.addEventListener('click', () => {
console.log('Hello')
})
return e
})()
document.body.append(v)
see ~/DOCS.md