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

@sarosia/e

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sarosia/e

A general purpose function to manipulate HTML DOM elements.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-80%
Maintainers
1
Weekly downloads
 
Created
Source

e

Build Status NPM Version NPM Downloads

e is a general purpose function to manipulate HTML DOM elements.

Usage

If the first argument is a string, it will return the element matching with that ID, or null if not elements is associated with that ID. The subsequce arguments will be used for update its attribute and children. For example,

e('div1') is equivalent to document.getElementById('div1'). e('div', {'style': 'color: red'}, 'Hello world') is equivalent to the following statements:

const div = document.getElementById('div1');
div.setAttribute('style', 'color: red');
div.innerHTML = 'Hello world';

If the param is an array, creates an HTML element based on the items in the array and return the element. The array should be in the form of the following:

element := [type, {attributes...}, children]
children := [elements...]|text

If the children is a list of array, construct the children recursively and append to the current node. If the children is a string, simply set the node's innerHTML.

License

MIT

FAQs

Package last updated on 19 May 2021

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