npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fadom

v0.0.1

Published

fadom is a lightweight virtual DOM library that provides an efficient way to update and manipulate the DOM. It's designed to be easy to use and integrate into any web application.

Downloads

1

Readme

Fadom: A Virtual DOM Library

fadom is a lightweight virtual DOM library that provides an efficient way to update and manipulate the DOM. It's designed to be easy to use and integrate into any web application.

Features

Virtual DOM implementation for efficient updates

Small size and minimal dependencies

Getting Started

To get started with fadom, you can simply include the library in your web application:

import fadom from '../dom;

You can also install fadom using a package manager like npm:

npm install fadom

Usage

Once you have included fadom in your web application, you can use it to create and manipulate virtual DOM elements:

// create a new virtual DOM element
const element = fadom.createElement('div', { id: 'my-element' }, [
  fadom.createElement('p', {}, 'Hello World!')
]);

// render the virtual DOM element to the real DOM
const vElement = fadom.render(element);

// Mount real Dom to container
fadom.mountElement(vElement, document.getElementById('app'));

// update the real DOM with the changes
fadom.update(element, newElement);

API fadom provides a simple API for creating and manipulating virtual DOM elements. Here are some of the key functions:

fadom.createElement(tagName, attributes, children)

Creates a new virtual DOM element with the given tag name, attributes, and children.

  • tagName - The tag name of the element (e.g. 'div', 'p', 'img').
  • attributes - An object containing any attributes to apply to the element (e.g. { id: 'my-element', class: 'my-class' }).
  • children - An array of child elements or text nodes.

fadom.render(element)

Renders the given virtual DOM element to the real DOM.

  • element - The virtual DOM element to render

fadom.mountElement(domElement, container)

  • domElement - Real Dom element
  • container - The DOM element to append the virtual DOM element into.

fadom.updateElement(element, newElement)

Updates the given virtual DOM element with the changes from the new virtual DOM element.

  • element - The virtual DOM element to update.
  • newElement - The new virtual DOM element with the changes

Contributing

If you'd like to contribute to fadom, you can fork the repository and submit a pull request with your changes. Please ensure that your changes are well-documented and include tests.

Inspired by Explained and created a simple virtual DOM from scratch

License

fadom is released under the MIT License. See LICENSE for more information.