
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.
Typescript Generalized Utility Library
converts callback based promise into a resolveable entity to retain 2 dimensional code flow
const awaitableObj = awaitable<boolean>();
try{
setTimeout(()=>awaitableObj.reject(new Error("Timed Out")),5000); // reject if not resolved within 5 seconds
something.withAsynchronousCallback((isSuccess)=>{
successBoolean ? awaitableObj.resolve(isSuccess) : awaitableObj.reject(new Error("unexpected data return"));
})
}
catch(err){
awaitableObj.reject(new Error("Not successful"));
}
const result = await awaitableObj.promise; // await any of the asynchronous/synchronous callback paths
console.log(result); // log result, resolution is of the awaitable type, rejection is of error in this example
simple inline asynchronous queueing system with simple idle sleep resource reduction
const exampleQueueDefaultInterval = 1000;
create_queue({
queue:"example queue",
interval: exampleQueueDefaultInterval,
limiter: limiter_throttle
}) // create queue with queue execution interval of 1000
const backoffQueueDefaultInterval = 1000;
create_queue({
queue:"backoff queue",
interval: backoffQueueDefaultInterval,
limiter: limiter_throttle
}) // create queue with queue execution interval of 1000
const someFn = async (data: any[]) => {
const newData = await Promises.all(
data.map(async (row) => {
console.log("do stuff. any stuff. async or not doesn't matter")
await queue({ queue:"example queue" }); // await until asynchronous ready signal from queue with name "example queue"
row.new_property = "someValue";
return row;
})
);
return newData;
}
const someFnWithExponentialBackoff = async (data: any[]) => {
while(true){
try{
await queue({ queue:"backoff queue" }); // await until asynchronous ready signal from queue with name "backoff queue"
const result = await fetchWithReturn();
if(result) {
backon_queue({ queue:"backoff queue" }); // tell queue to reset backoff to behave on normal interval;
break;
}
}
catch(err){
console.error(err);
}
finally {
backoff_queue({ queue:"backoff queue" }); // tell queue to backoff
}
}
}
asynchronous timeout function which blocks 2 dimensional flow until millisecond timeout return;
console.log("start",new Date().toISOString());
await timeout(1000) // 1 second timeout
console.log("end",new Date().toISOString());
limiting execution class capable of throttle, debounce & lockout
// To Be Documented
npm run dev
npm run build
npm run test
FAQs
TypeScript Generalized Utility Library
We found that tgul demonstrated a healthy version release cadence and project activity because the last version was released less than 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
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.