jselestial

0.1.0 • Public • Published

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>)

Readme

Keywords

none

Package Sidebar

Install

npm i jselestial

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

3.9 kB

Total Files

4

Last publish

Collaborators

  • roecrew