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.
auto-elems-from-dom
Advanced tools
Get elements from DOM (reference to DOM, document fragment) or string easily!
Get elements from DOM (reference to DOM, document fragment) or string easily!
$ npm install --save auto-elems-from-dom
require('auto-elems-from-dom/polyfill');
var autoElemsFromDom = require('auto-elems-from-dom');
// autoElemsFromDom(dom, type, name, flat)
// type: attr, name: data-elo
var a = autoElemsFromDom('<div data-elo="s1"><div data-elo="s2">111</div></div><div data-elo="s1">111</div>', 'attr', 'data-elo');
console.log(a, a.elems); // dom, elems ({s1: [], s2: []})
// type: attr, name: mega-elo
var a1 = autoElemsFromDom('<div mega-elo="s1"><div mega-elo="s2">111</div></div><div mega-elo="s1">111</div>', 'attr', 'mega-elo');
console.log(a1, a1.elems); // dom, elems ({s1: [], s2: []})
// type: data, name: elo
var b = autoElemsFromDom('<div data-elo="s1" class="elo-s1"><div data-elo="s2" class="dssd elo-s2 assdsd">111</div></div><div data-elo="s1" class="ss elo-s1">111</div>', 'data', 'elo');
console.log(b, b.elems); // dom, elems ({s1: [], s2: []})
// type: class, name: elo
var c = autoElemsFromDom('<div class="elo-s1"><div class="dssd elo-s2 assdsd">111</div></div><div class="ss elo-s1">111</div>', 'class', 'elo');
console.log(c, c.elems); // dom, elems ({s1: [], s2: []})
// type: class, name: elo, flat: true
var d = autoElemsFromDom('<div class="elo-s1"><div class="dssd elo-s2 assdsd">111</div></div><div class="ss' +
' elo-s1">111</div>', 'class', 'elo', true);
console.log(d, d.s1, d.s2); // dom, elems (dom.s1, dom.s2)
FAQs
Get elements from DOM (reference to DOM, document fragment) or string easily!
The npm package auto-elems-from-dom receives a total of 0 weekly downloads. As such, auto-elems-from-dom popularity was classified as not popular.
We found that auto-elems-from-dom 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.