
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@newhippo/get-dom
Advanced tools
Return a Window, Document, or DOMImplementation instance in both Node and the browser
This is a very simple module. Use it whenever you need to have access to either a Document
or a
DOMImplementation
instance in Node or the browser transparently.
When running in Node, this will use jsdom
to provide you with the right objects. While jsdom
works in the browser, it's a pretty big dependency to have and you already have a DOM there. So
when loaded in a browser this module does not at all depend on jsdom
but rather returns the
current document
and its document.implementation
. (If you want a new instance, just use the
DOMImplementation
to create one).
NOTE: This only works with bundlers that respect the browser
field in package.json
(Browserify does, I guess the other big ones do too).
The major version number for this module now tracks that of jsdom
.
npm install get-dom
import dom from 'get-dom';
let doc = dom.document();
let impl = dom.implementation();
let wind = dom.window();
Or for those of you who like your JS retro:
var dom = require('get-dom');
var doc = dom.document();
var impl = dom.implementation();
var wind = dom.window();
You can look under example-browser
to see how this works in the browser, once browserified.
FAQs
Return a Window, Document, or DOMImplementation instance in both Node and the browser
The npm package @newhippo/get-dom receives a total of 51 weekly downloads. As such, @newhippo/get-dom popularity was classified as not popular.
We found that @newhippo/get-dom demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.