Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
container-doublylist
Advanced tools
DoublyList implementation in JavaScript
To manage a list of elements. Best use case: elements are frequently removed from the list. Complexity in O(1) for addition and removal.
Note: Benchmarks seem to show that list iteration is as fast as array iteration on all major browsers.
To instantiate a new list:
var myList = new DoublyList();
To add an element:
var myObjectReference = myList.add(myObject); // add on front by default
// or
var myObjectReference = myList.addFront(myObject);
// or
var myObjectReference = myList.addBack(myObject);
To remove an element:
myList.removeByReference(myObjectReference); // O(1)
// or
myList.remove(myObject); // O(n)
To pop an element:
var myObject = myList.pop(); // pop from front by default
// or
var myObject = myList.popFront();
// or
var myObject = myList.popBack();
To insert an element before the given node:
var myOtherObjectReference = myList.addBefore(myObjectReference, myOtherObject);
To insert an element after the given node:
var myOtherObjectReference = myList.addAfter(myObjectReference, myOtherObject);
To move an element to the beginning:
myList.moveToTheBeginning(myObjectReference);
To move an element to the end:
myList.moveToTheEnd(myObjectReference);
To iterate through the elements:
for (var node = myList.first; node !== null; node = node.next) {
node.object += 1;
}
To apply a treatment on all the elements:
myList.forEach(function (object) {
console.log(object);
});
To convert into an array:
var myArray = myList.toArray();
FAQs
DoublyList implementation in JavaScript
The npm package container-doublylist receives a total of 283 weekly downloads. As such, container-doublylist popularity was classified as not popular.
We found that container-doublylist 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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.