Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

attodom

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

attodom

yet another small DOM component library

  • 0.5.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

attodom

yet another experimental small DOM component library, <2kb

WhyAPILicense

Why

  • experimenting on different APIs to find the minimal helpers required for
    • dynamic nodes, elements and lists
    • one way data flow from root component to child nodes

Features

  • multiple dynamic lists within the same parent
  • svg and namespace support
  • ability to inject a document API for server use and/or testing (e.g. jsdom)
  • no virtual DOM, all operations are done on actual nodes
  • <2kb gzip, no dependencies
  • Designed for older browsers, low memory requirement and no transpilation required

Limitations

  • view and event helpers only
  • limited css utility
  • strictly DOM element creation and manipulation (no router, no store)

API

Elements (hyperscript)

  • el(tagName [, attributes [,children]] ): HTMLElement
  • svg(tagName [, attributes [,children]] ): SVGElement

Components

  • co(Element, config, children): Component
  • .node the component's associated element
  • .update(value) the function to trigger changes based on external data
  • .updateChildren(array) to update all child components

By default, update is set to updateChildren for ParentNodes, setValue form HTMLInputElement and setText for others. To change the update function, specify it in the config object {update: myUpdateFunction}

Lists

  • list(componentFactory, getKey) List must be added as children to a component to be activated

Server use

Document can be injected as follow:

const root = require('attodom/root')
root.document = myDocumentObject

License

MIT © Hugo Villeneuve

Keywords

FAQs

Package last updated on 21 Jan 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc