New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

morphlex

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

morphlex

A tiny, optimal DOM morphing library written in TypeScript.

  • 0.0.11
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Morphlex

Morphlex is a tiny, safe, optimal DOM morphing library written in TypeScript.

[!WARNING] Morphlex is currently in development and it not yet ready for production use.

ID Sets

Inspired by Idiomorph, Morphlex uses ID Sets to match nodes with deeply nested identified elements.

Node sensitivity

Morphlex will give priority to sensitive elements such as iframes, media players, and form inputs, forcing less sensitive elements to move around them. This works in any direction even if the sensitive element is deeply nested.

Streaming morph [WIP]

Because the Morphlex algorithm works depth-first, sequentially through reference DOM, it should be able to consume a stream of reference nodes, morphing the target DOM in real-time. This feature is not yet implemented.

Usage

import { morph } from "morphlex";

morph(currentNode, referenceNode);

The currentNode will be morphed into the state of the referenceNode. The referenceNode will not be mutated in this process.

Run tests

  • npm install
  • npm watch
  • in another tab npm run "test:watch"

FAQs

Package last updated on 06 Mar 2024

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