
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
readystate is a module to determine the readystate of the current document
and allows you to listen to various of readystate change events.
The module is available for Node.js and Browsers (using browserify) and can be installed by running the following command in your CLI:
npm install --save readystate
In all examples we assume that you've required the library as following in your code:
'use strict';
var readystate = require('readystate');
The readystate is a pre-constructed ReadyState instance which exposes
various of methods to check and listen to readystate changes. Before
continuing with the API here is a list of the ready state's that we currently
support:
ALL: The I don't really give a fuck state.UNKNOWN: We got an unknown readyState we should start listening for events.LOADING: Environment is currently loading.INTERACTIVE: Environment is ready for interaction.COMPLETE: All resources have been loaded.The INTERACTIVE state can be used for DOM ready and the COMPLETE for load
events.
The is method allows you check if a certain readystate has been reached. It
is not a strict check but a minimum check. For example if you want to know if
the LOADING state has been reached but your document is already in the
COMPLETE state we will return true.
// assume that document is fully loaded, these will all return true.
readystate.is('loading');
readystate.is('LOADING');
readystate.is(readystate.LOADING);
// assume that document is in `loading` state, these will return false
readystate.is('interactive');
readystate.is('INTERACTIVE');
readystate.is(readystate.COMPLETE);
We also you to assign callback for when a certain readystate is reached. If
the state has yet to be reached we will queue your callback until the state is
reached. If we are already in that state we will immediately call the supplied
callback.
readystate.loading(function () { console.log('loading'); });
readystate.complete(function () { console.log('complete'); });
readystate.interactive(function () { console.log('interactive'); });
It also supports a second context argument which allows you to control the
this value of your callback:
readystate.loading(function () {
console.log(this); // 'foo'
}, 'foo');
Remove all previously assigned listeners.
readystate.removeAllListeners();
Please note, this is a private property
We store our current detected readystate in the .readystate it might be
useful it you want to some manual checking.
MIT
FAQs
Get the current readyState of the environment we're loaded in.
The npm package readystate receives a total of 13 weekly downloads. As such, readystate popularity was classified as not popular.
We found that readystate demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.