
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.
@extra-js/deferred
Advanced tools
A simple wrapper around Promise API to programmatically trigger resolution or rejection
A simple promise-like object which exposes resolve
and reject
methods.
import assert from 'assert';
import { Deferred } from '@extra-js/deferred';
process.on('unhandledRejection', (error) => {
throw error;
});
async function main() {
const future: Deferred<string> = new Deferred<string>();
setTimeout(future.resolve.bind(future, 'foo'));
const val = await future;
assert(val === 'foo', 'operation should be resolved');
}
main.call(this);
import assert from 'assert';
import { Deferred } from '@extra-js/deferred';
process.on('unhandledRejection', (error) => {
throw error;
});
async function main() {
const future: Deferred<string> = new Deferred<string>();
setTimeout(future.reject.bind(future, new Error('foo')));
try {
await future;
} catch (error) {
assert(error.message === 'foo');
}
}
main.call(this);
import assert from 'assert';
import { Deferred } from '@extra-js/deferred';
process.on('unhandledRejection', (error) => {
throw error;
});
async function main() {
const TIMEOUT = 1000; // 1s
const future: Deferred<string> = new Deferred<string>(TIMEOUT);
try {
await future;
} catch (error) {
assert(error.message === 'Timeout');
}
}
main.call(this);
FAQs
A simple wrapper around Promise API to programmatically trigger resolution or rejection
We found that @extra-js/deferred 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
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.