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.
@akashbabu/node-dll
Advanced tools
DLL(Doubly linked list) implementation for javascript projects
Doubly linked list(DLL) is inevitable in certain situation where performance is preferred while slicing an array (maybe there are more to it, but this is mostly my PoV).
So this library was created with a simple, yet powerful interface for interacting with the underlying DLL
schema.
This library is written in typescript for robust APIs and type support.
Every aspect was desgined and thought carefully to minimize introducing new bugs.
API method name has been carefully chosen to nearly match Array methods, such that learning curve is least and adaptability is higher. But a few methods couldn't have had a different name and we had to convince ourselves with those method name.
npm i @akashbabu/node-dll -S
import {DLL, DLLItem} from '@akashbabu/node-dll';
const dll = new DLL<string>();
const dllItem: DLLItem<string> = dll.push('foo');
console.log(dllItem.data) // => foo
console.log(dll.length) // => 1
dll.remove(dllItem)
console.log(dll.length) // => 0
dll.push('foo')
dll.unshift('bar')
const headItem = dll.head
console.log(headItem.data) // => bar
const headData = dll.shift()
console.log(headData) // => bar
console.log(dll.head.data) // => foo
dll.clear()
console.log(dll.length) // => 0
const firstItem = dll.push('first')
dll.push('third')
dll.appendAfter(firstItem, 'second')
dll.forEach((item, i) => {
console.log(`${i + 1}) ${item}`);
})
// => 1) first
// => 2) second
// => 3) third
console.log(dll.map((item, i) => `${i + 1}) ${item}`));
// => ["1) first", "2) second", "3) third"]
This creates a new instance of DLL
.
T -> Denotes the type of data being saved in DLL
Returns the first item in the list
Returns the last item in the list
Returns the length of the list
Removes and returns the first item in the list. Returns undefined
if the list is empty
Adds the given item to the head of DLL (same as Array.unshift logic)
Iterates through the entire DLL
Iterates through the entire DLL and returns the resultant array.
U -> Denotes the return type of cb
(callback)
Adds the given item to the tail of DLL and returns the added item
Adds the given data after the given dllItem in DLL and returns the added item
Removes the given item from DLL and returns true if the removal was successful
Removes all the items in the DLL
DLLItem has a readonly access to prev
and next
properties, this is to ensure that the users doesn't change them unintentionally (which can mess up with the entire DLL) and hence less surface for bugs.
Set / get data value on the DLLItem via this property
Get prev value on the DLLItem via this property
Get next value on the DLLItem via this property
All contributions are welcome!!!
But before raising any issue, please check the issue-tracker in github if there is any matching issues already in the pipeline, if not then please go ahead and raise your own.
PR Guidelines:
MIT
FAQs
DLL(doubly linked list) library for javascript projects
The npm package @akashbabu/node-dll receives a total of 961 weekly downloads. As such, @akashbabu/node-dll popularity was classified as not popular.
We found that @akashbabu/node-dll 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
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.