
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
f-async-resolver
Advanced tools
Make your functions async without the need of doing it in the same Function
Make your functionas async.
This module is made so you can make your funcions async and return a value without the need of having it in the same function. For example returning an answer from a server in a WebSocket connection.
npm i f-async-resolver
const async = require('f-async-resolver').resolver;
const resolver = new async();
Awaiting for a Number
const async = require('f-async-resolver');
const resolver = new async.resolver();
function number() {
return new Promise(solver => {
resolver.await('number', solver);
});
}
number.then(number => {
console.log(number);
});
setTimeout(() => {
resolver.resolve('number', 15);
}, 1000);
/*
Output (1 Second after running the Code)
> 15
*/
Awaiting for WebSockets message.
const async = require('f-async-resolver');
const resolver = new async.resolver();
const WebSocket = require('ws');
class database {
constructor(IP) {
this.ws = new WebSocket('ws://127.0.0.1:4000'); // Connects to a Server.
this.ws.onopen = this.onopen.bind(this); // Simple function Bind.
this.ws.onmessage = this.onmessage.bind(this); // Simple function Bind.
}
onopen() {
console.log('Connected!');
}
get() {
return new Promise(solver => { // Returns a Promise and makes 'solver' to solve.
this.ws.send({
type: 'getDatabase'
}); // Sends a message to the Server
resolver.await('getDB', solver); // Sets label and function to Solve.
});
}
onmessage(msg) {
resolver.resolve('getDB', msg); // Solves 'getDB' label with msg value.
}
};
const connection = new database('ws://127.0.0.1:4000');
connection.get().then(msg => {
console.log('Awaited for ' + msg); // Shows the message Recieved.
});
FAQs
Make your functions async without the need of doing it in the same Function
We found that f-async-resolver 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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.