apajs
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published
Cute water drop with eyes and smile

ApăJS

Apă (water, in Romanian) – For when you just need a little hydration.

Intro

ApăJS is a minimal library aiming at reducing boilerplate around web components, yet keeping them fairly "vanilla". With its ~3kb (minified, ~1kb gzipped), it provides out-of-the-box:

  • A way of creating web components with a functional approach
  • Automatically add event handlers to DOM elements
  • Automatically store references to the DOM to lower the boilerplate around query selectors
  • First-class support for server-side rendered HTML

Getting started

The easiest way of getting started is via esm. You can import the main functions from there:

import { define, html } from "https://esm.sh/apajs@1.0.2";

define({ tag: "hello-world" }, function () {
  return html`<h1>Hello world!</h1>`;
});

Alternatively, if you want to use npm, npm i apajs.

Documentation is still WIP. If you're super curious and want to test it out, please take a look a the examples directory. There you can find several examples to have a first feel of how the syntax looks like!

/apajs/

    Package Sidebar

    Install

    npm i apajs

    Weekly Downloads

    7

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    32.2 kB

    Total Files

    15

    Last publish

    Collaborators

    • alpalma95