View on Github

DarkWiiPlayer/JS

A collection of JavaScript modules to make front-end easier.

Skooma.js

Skooma lets you generate DOM nodes in JavaScript. Read more

Code Sample:

import {html} from 'skooma.js' let div = html.div([ html.h1('Hello, World!'), html.p('Here is some text', {class: ["class_a", "class_b"]}) html.button("Click Me!", { click: event => console.log(event) }) ])

Element

A helper function that adds many convenient features to classes for custom elements. Read More

Code Sample:

import element from 'element.js' element(class MyElement extends HTMLElement { static attributes = { foo: true } fooChanged(oldFoo, newFoo) { console.log(`Foo changed from ${oldFoo} to ${newFoo}`) render() } $render() { /* ... */ } })

Listener

Like a normal object, except you can register callbacks for property changes. Read More

Code Sample:

import listener from 'listener.js' const user = listener({name: "John Doe"}) user.listen('name', value => console.warn(`User name has changed to ${value}`))

Speaker

Publish and subscribe to messages, relayed via micro-tasks. Read More const speaker = new Speaker() speaker.listen((...args) => console.log(...args)) speaker.speak("First", "second", "third") No, this has nothing to do with playing audio.

Debounce

Debounces data like user input or events that can occur in a burst. Read More

Code Sample:

import debounce from 'debounce.js' input.addEventListener("change", debounce(event => update(input.value)))