
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.
Clide is a simple render loop for snabbdom.
npm install clide
import { init, h } from 'clide'
import sbEvents from 'snabbdom/modules/eventlisteners'
init([ sbEvents ])(counter)
function counter (lens) {
const { count = 0 } = lens()
return h('button', {
on: {
click: () => lens({ count: count + 1 })
}
}, count)
}
import { init, h } from 'clide'
import sbEvents from 'snabbdom/modules/eventlisteners'
init([ sbEvents ])(app)
function app (lens) {
return h('div', [
counter(lens('one')),
counter(lens('two'))
])
}
function counter (lens) {
const { count = 0 } = lens()
return h('button', {
on: {
click: () => lens({ count: count + 1 })
}
}, count)
}
import { init, h } from 'clide'
import sbEvents from 'snabbdom/modules/eventlisteners'
init([ sbEvents ])(app)
function app (lens) {
const { counters = [] } = lens()
return h('div', [
h('div', counters.map((_, idx) =>
counter(lens('counters', idx)))),
h('button', {
on: {
click: () => lens({ counters: counters.concat([ {} ]) })
}
}, '+')
])
}
function counter (lens) {
const { count = 0 } = lens()
return h('button', {
on: {
click: () => lens({ count: count + 1 })
}
}, count)
}
init(modules)The init function takes an optional array of extra snabbdom modules to load
and returns the render function. See the snabbdom init
docs for more details about
loading extra snabbdom modules.
render(view, options)The render function is returned by init. This function should be called with a
view function, and optionally an options object. The options object
may contain the following properties:
| Property | Default | Description |
|---|---|---|
| state | {} | The initial state that should be returned by lens(). |
| root | document.body | The DOM node to attach the view function to. |
view(lens)The view function is written by the developer, and should expect one argument:
a lens from stateful-lens. This
function must return a snabbdom virtual
dom node. Updating the lens in this function will trigger a re-render. See the
stateful-lens docs for more
information.
FAQs
A thin layer over snabbdom.
The npm package clide receives a total of 62 weekly downloads. As such, clide popularity was classified as not popular.
We found that clide 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.