Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
dens, A DOM utility library that uses native methods and returns native HTMLElement. ================
Idea: Native APIs are first-class citizen, always return native HTMLElement.
import {den, dens} from "dens"
- node is element or text node
- element is element
- text is text node
if not defined $ and $$, it will define
window.$ = function(selector) { return typeof selector === "string" ? document.querySelector(selector) : selector || null }
window.$$ = function(selector) { return [].slice.call(document.querySelectorAll(selector)) }
den("#parent").insertAfter(node, $("#child-a"))
[].slice.call(x.childNodes)
dens.closest("#hello")
den(selector) -> <#Den>
- closest(selectorString) -> HTMLElement
- isAncestor(ancestorNode)
- insertAfter(newNode, referenceNode)
- remove()
###########
# Class methods
###########
- den.isNode(obj) .. isElement isText isDocument isWindow
- den.isIE(maxVersion) .. isIOS isMac
- den.createElement(htmlText) -> HTMLElement
$ npm install denjs --save
$ boewr install denjs --save
from medium-editor selection.js
getSelectedElements: function (doc) {
rangeSelectsSingleNode: function (range) {
getSelectedParentElement: function (range) {
getCaretOffsets: function getCaretOffsets(element, range) {
getSelectionHtml: function getSelectionHtml(doc) {
importSelection: function (selectionState, root, doc, favorLaterSelectionAnchor) {
exportSelection: function (root, doc) {
from quill lib/dom.js
...
FAQs
dens, A DOM utility library that uses native methods and returns native HTMLElement. ================
The npm package dens receives a total of 1 weekly downloads. As such, dens popularity was classified as not popular.
We found that dens 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.