jselestial
v0.1.0
Published
markup/style/script processing via json
Downloads
3
Readme
jselestial
markup/style/script processing via json
What is this?
This program transforms this schema...
[
{
"name": "root",
"markup": "<div>|item|</div>",
"style": "",
"script":""
},
{
"name": "item",
"markup": "./item.html", // takes inline or path
"style": "$this { color: green;}",
"script": "document.querySelector($this).querySelector('span').color = 'red';"
}
]
Into this...
[
{
name: 'root',
markup: '<div><span>Hello World!</span></div>',
style: '',
script: '',
id: 'jstl-0'
},
{
name: 'item',
markup: '<span>Hello World!</span>',
style: '#jstl-1 { color: green;}',
script: `document.querySelector("#jstl-1").querySelector('span').color = 'red';`,
id: 'jstl-1'
}
]
Happy coding :)
npm i jselestial
const json = require('jselestial')(<jsonfilepath>)