
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Reactive view library based on tagged template literals. It is special compared to other similar libraries in that it implements it's own XHTML/HTML parser.
The main features are
A simple TypeScript example
import * as Doremifa from 'doremifa'
const html = Doremifa.html;
const setState = Doremifa.setState
Doremifa.setState({
time:(new Date).toTimeString(),
})
Doremifa.mount(document.body, state => html`<div>Hello World! ${state.time}</div>`)
setInterval( _ => { setState({time:(new Date).toTimeString()})},1000)
Hello World in CodePen Router Example in CodePen
npm i doremifa
And then
import { mount, router, getState, setState, html, drmfComponent, drmfTemplate } from 'doremifa';
// or
import * as Doremifa from './index';
To construct a Template you can write JavaScript template literal
html`<div>${"Hello World"}</div>`
Mount render function to some element
Doremifa.mount(document.body, state => html`<div>Hello World!</div>`)
Any function which returns drmfTemplate can be used as a component
function message(txt) {
return html`<div>${txt}</div>`
}
const example = html`<div>${message(txt)}</div>`
Objects which implement render() -function and inherit from drmfComponent can be used as part of templates.
class Hello extends drmfComponent {
render() {
return html`<div>Hello World </div>`
}
}
const obj = new Hello(); // create and re-use if needed
Doremifa.mount(document.body, state => html`<div>${obj}</div>`)
const style='color:blue;'
html`<div style=${style}/>`
Event handlers get two params:
e the HTML eventtpl the drmfTemplate -object which can old ID or list valueshtml`<button onclick=${(e, tpl) => {
// tpl holds the template object
}}>Click me!</button>`
References are collected from templates to two colletions:
ids holds elements having "id" attribute setlist holds elements having list="something" setThe are also available to event handlers.
html`<div>
<input id="name" />
<div list="divs" />
<div list="divs" />
<button onclick=${(e, tpl) => {
alert(tpl.ids.name) // value of input
alert(tpl.list.divs.length) // 2
}}>Click me!</button>
</div>`
Sometimes you want to manipulate DOM after the template has been rendered
html`<div></div>`.onReady( tpl => {
// tpl.ids
// tpl.list
})
There are no custom tags, just functions or objects.
The application has a global state which is accessed using
getState()setState({...})When state is updated, rendering is triggered and all parts of the application are processed. This should be extremely fast, since templates are cached and only changed parts are updated.
No. Promises are not part of view tree. Just update state and view changes reactively.
Build -in router router uses window.location.hash and acceptse links in format
<a href="#page1/param1/value1/param2/value2">Link to page 1</a>
<a href="#page2/param1/value1/param2/value2">Link to page 2</a>
Then you can define router anywhere in templates like
html`<div>
${Doremifa.router({
page1 : (state) => html`page1`,
page2 : (state) => html`page2`,
})
</div>`
The router component gets the state having following variables set
{
"page": "page2",
"params": {
param1 : value1,
param2 : value2
}
}
MIT.
FAQs
Reactive DOM library based on template literals
The npm package doremifa receives a total of 1 weekly downloads. As such, doremifa popularity was classified as not popular.
We found that doremifa demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.