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.
den, A DOM utility library that uses native methods and returns native HTMLElement. ================
Idea: Native APIs are first-class citizen, always return native HTMLElement.
- 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)
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
- den.keystroke(event) -> "a" "ctrl-a" "ctrl-alt-shift-cmd-a"
$ 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
den, A DOM utility library that uses native methods and returns native HTMLElement. ================
The npm package denjs receives a total of 0 weekly downloads. As such, denjs popularity was classified as not popular.
We found that denjs 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.