Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
The domready npm package is a lightweight utility that allows you to execute a function when the DOM is fully loaded. It is particularly useful for ensuring that your JavaScript code runs only after the HTML document has been completely parsed.
Execute a function when the DOM is ready
This feature allows you to pass a callback function that will be executed once the DOM is fully loaded. It ensures that your code runs at the appropriate time, avoiding issues related to elements not being available in the DOM.
require('domready')(function () {
console.log('DOM is ready!');
});
The dom-loaded package provides similar functionality by allowing you to execute a function when the DOM is fully loaded. It offers a promise-based API, which can be more convenient for modern JavaScript development. Unlike domready, dom-loaded returns a promise that resolves when the DOM is ready.
The document-ready package is another alternative that provides a simple way to execute a function when the DOM is ready. It is similar to domready but offers a slightly different API. It is also lightweight and easy to use.
The ready package is a small utility that allows you to run a function when the DOM is ready. It is similar to domready but provides additional features such as checking if the DOM is already loaded before executing the callback.
It's easy. Works like this:
domready(function () {
// dom is loaded!
})
Compatibility with IE6
, IE7
, and IE8
has been fully dropped. If your application requires this level of support, please use the 0.3.0
release.
npm install
make
open tests/test.html
Don't already have Ender? Install it like this:
npm install ender -g
Include domready in your package:
ender add domready
Then use it like this
require('domready')(function () {
$('body').html('<p>boosh</p>')
})
// or
$(document).ready(function () {
$('body').html('<p>boosh</p>')
})
FAQs
modern domready
The npm package domready receives a total of 238,686 weekly downloads. As such, domready popularity was classified as popular.
We found that domready demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.