No description
Find a file
2026-07-24 10:03:28 +02:00
documentation Fix example in documentation for dom array 2026-07-18 16:06:56 +02:00
.editorconfig Add basic editorconfig 2024-06-24 12:27:05 +02:00
controller-registry.js Improve controller registry typing 2026-07-07 16:32:32 +02:00
controllers.js Add ControllerRegistry 2026-02-19 21:08:00 +01:00
domProxy.js Remove leftover console.log 2026-07-18 16:05:51 +02:00
importmaps.html Update importmaps template 2026-07-05 16:29:58 +02:00
jsconfig.json Add jsdoc class annotations to skooma module 2024-02-12 13:38:57 +01:00
license.md Update metadata 2023-10-04 10:35:56 +02:00
mini.js Add explanation to mini-renderer 2025-11-15 20:16:57 +01:00
observable.js Made the Observable.new error a bit friendlier :3 2026-07-16 09:14:45 +02:00
package.json Bump version to 0.6 2026-07-24 10:03:28 +02:00
readme.md Add jsdelivr badge to readme 2026-02-24 15:09:23 +01:00
ref.js Extract Ref class into separate module 2024-02-29 15:33:26 +01:00
render.js Fix typo in reactive dataset elements 2026-07-16 19:28:46 +02:00

Nyooom

A lean and hackable front-end micro-framework

import {html} from "nyooom/render"
import {Observable} from "nyooom/observable"

const text = new Observable({value: "Nyooom is cool"})
setTimeout(() => {text.value = "Nyooom is awesome!"}, 1e5)

document.body.append(html.div(
    html.h1("Hello, World!"),
    html.p(text.signal("value"), {class: "amazing"}),
    html.button("Show Proof", {click: event => { alert("It's true!") }})
))

Goals

Arrakis teaches the attitude of the knife - chopping off what's incomplete and saying: "Now, it's complete because it's ended here."

— Frank Herbert, Dune

Nyooom aims to offer as much convenienve as possible within the following constraints:

  1. Small, independent modules that can also work on their own
  2. Easy to figure out by someone who doesn't normally use nyooom
  3. Easy to gradually introduce and remove rather than forcing big re-writes
  4. Flexible and hackable

Importmaps

The included file importmaps.html can be used as a starting point for importing nyooom via importmaps in a minimal environment. Search-and-replace ./ to wherever the library should be loaded from if necessary.

A few more examples:

Create a Button that deletes itself:

document.body.append(
	html.button("Delete Me", {click: event => event.target.remove()})
)

Turn a two-dimensional array into an HTML table:

const table = rows =>
	html.table(html.tbody(rows.map(
		row => html.tr(row.map(
			cell => html.rd(cell, {dataset: {
				content: cell.toLowerCase(),
			}})
		))
	)))

A list that you can add items to

let list, input = ""
document.body.append(html.div([
	list=html.ul(),
	html.input({type: 'text', input: e => input = e.target.value}),
	html.button({click: event => list.append(html.li(input))}, "Add"),
]))

A list that you can also delete items from

const listItem = content => html.li(
	html.span(content), " ", html.a("[remove]", {
		click: event => event.target.closest("li").remove(),
		style: { cursor: 'pointer', color: 'red' },
	})
)
let list, input = ""
document.body.append(html.div([
	list=html.ul(),
	html.input({type: 'text', input: e => input = e.target.value}),
	html.button({click: event => list.append(listItem(input))}, "Add"),
]))