Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
tsdom
Advanced tools
Readme
Fast, lightweight DOM manipulation utility with TypeScript definitions. 1.8kb gzipped.
npm install --save tsdom
Add the package to your project using one of the following:
let tsdom = require('tsdom')
import tsdom from 'tsdom'
<script src="./tsdom.inc.js" />
("tsdom/dist/tsdom.inc.js")TSDom uses CSS (or jQuery) selector syntax, e,g:
let el = tsdom(element)
let el = tsdom("div")
let el = tsdom("#yourId")
let el = tsdom(".yourClass")
let el = tsdom("[data-attribute]")
Once you've selected an element or elements, you can chain the following methods:
el.first()
el.find("#yourSelector")
el.closest(".yourSelector")
el.each(e => { // do something })
el.append("<p>Lorem ipsum</p>" | Node | HTMLElement)
el.prepend("<p>Lorem ipsum</p>" | Node | HTMLElement)
el.empty()
el.addClass("yourClass")
el.removeClass("yourClass")
el.toggleClass("yourClass")
el.css({ opacity: "0" })
el.attr({ title: "Your new title" })
el.on("click", (ev: Event, el: HTMLElement) => { // do something })
el.on("click", ".yourClass", (ev: Event, el: HTMLElement) => { // do something })
el.off("click")
The following are return methods
el.get(0)
el.hasClass("active")
el.val()
el.val("value")
el.text()
el.text("Lorem ipsum")
el.data("key")
el.data("key", "value")
el.attr("key")
el.html()
el.html("<div>Lorem ipsum</div>")
el.toArray()
And these are NON return methods
el.remove()
The package exports the following type namespace for use in your app:
import tsdom, { TSDom } from 'tsdom'
TSDom.Init
== tsdom
TSDom.Object
== tsdom("#yourSelector")
FAQs
Fast, lightweight JavaScript DOM manipulation utility
The npm package tsdom receives a total of 88 weekly downloads. As such, tsdom popularity was classified as not popular.
We found that tsdom demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.