Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
anothersequencer
Advanced tools
Simple script tree sequencer in javascript. Allows creating fairly complex trees of sync/async functions or requestAnimationFrame functions with optional delays, as well as subscribing to particular outputs in the tree at any time.
Quick and dirty script sequencer. Create function trees, add async/requestAnimationFrame or delays, and subscribe to tagged outputs in the trees.
npm i anothersequencer
Usage:
let sequencer = new Sequencer();
//simple
let sequence1 = [
first(){console.log('1'); return 2;},
second(input){console.log(input); return 3;}, //should log "2"
async (input) => {console.log(input)} //yeah whatever
];
//complex
let sequence2 = [{
tag:'begin'
operation:(input)=>{}, //the callback
next:[{
delay:100 //milisecond delay before this operation is called
operation:(input)=>{}, //next callback
next:[
{
tag:'anotheroperation' //tags let you subscribe to these results
delay:100,
operation:async (input)=>{}, //etc
async:true //can toggle if the operations should run async, or use frame:true to use requestAnimationFrame
},
{
operation:async (input)=>{},
frame:true, //uses requestAnimationFrame which is a special async function for frame and context-limited calls
//next:[{...}]
}
]
}]
}];
let onResult = (input) => {
console.log(input);
}
sequencer.addSequence('test1',sequence1);
sequencer.addSequence('test2',sequence2);
let sub = sequencer.subscribeToOperation('anotheroperation',onResult); //adds a triggered function on result
//sequencer.unsubscribeFromOperation('anotheroperation',sub); //leave sub blank to remove all triggers. You could even, say, subscribe one sequence to another tagged sequence even, I don't know why but sure it's cool.
Other functions less obvious to use:
sequencer.getSequence(
name,
layer //optional
);
sequencer.appendSequence(
name, //name of sequence
layer, //layer 2 is the second layer, etc. leave blank to append on first layer
setting={ //object or function, functions cannot have more layers added
//operation = (result) => {} //callback for the sequence, takes the previous result
//delay:undefined, //set to a millisecond value
//async:undefined //set async:true or frame:true depending on if you want normal async or frame-timed async (which also won't run if you are out of the tab)
},
index //if you are appending to .next of an operation in a particular sequence layer you can use this. Leave blank to just add the setting to the specified layer instead
)
sequencer.removeSequence(
name,
layer, //optional
index //optional
);
//this is used recursively by runSequence otherwise to iterate a layer
sequencer.runSequenceLayer(
layer=[],
previousResult
)
FAQs
Simple script tree sequencer in javascript. Allows creating fairly complex trees of sync/async functions or requestAnimationFrame functions with optional delays, as well as subscribing to particular outputs in the tree at any time.
The npm package anothersequencer receives a total of 2 weekly downloads. As such, anothersequencer popularity was classified as not popular.
We found that anothersequencer 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.
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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.