
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.
@dandre3000/list
Advanced tools
A double linked list class with an API similar to the Array class and a corresponding list node class.
Exports a List class that represents a double linked list with an API based on the Array class, and a ListNode class that represents a node that may be contained in a List.
npm install @dandre3000/list
import { List, ListNode } from '@dandre3000/list'
// Add values
const list = new List(1, 2, 3)
list.push(4, 5)
list.unshift(0)
// Remove values
list.pop()
list.shift()
// Iterate values
for (const node of list) {
console.log(node.value) // 1, 2, 3, 4
}
// Access nodes
const firstNode = list.first
const lastNode = list.last
const nodeAt2 = list.at(2)
// Node operations
console.log(nodeAt2 === lastNode.previous) // true
new ListNode(6).appendTo(lastNode)
// Iterative methods
list.filter(({ value }) => value & 1 ^ 1)
.map(({ value }) => value * 2)
// Conversion methods
list.nodes()
list.values()
console.log(list.toString()) // 2,6
Click here to view full type definitions
value: T
list: List<T> | null
null if not in a listprevious: ListNode<T> | null
nullnext: ListNode<T> | null
nullconstructor(value: T)
ListNode instance with the given valueconstructor(value: T, list: List<T>, index: number)
ListNode and inserts it into the given list at the specified indexprependTo(node: ListNode<T>): this
appendTo(node: ListNode<T>): this
insertInto(list: List<T>, index: number): this
remove(): this
from<T>(items: Iterable<T>): List<T>
List instance from an iterablefrom<T, U>(items: Iterable<T>, mapFn: (element: T, index: number) => U, self: any): List<U>
List instance with the mapped values of an iterablefromAsync<T>(items: Iterable<T> | AsyncIterable<T>): List<T>
List instance from an iterablefromAsync<T, U>(items: Iterable<T> | AsyncIterable<T>, mapFn: (element: T, index: number) => U, self: any): List<U>
List instance with the mapped values of an iterablefirst: ListNode<T>
null if emptylast: ListNode<T>
null if emptylength: number
constructor(length: number)
constructor(...values: T[])
List and inserts the given valuesat(index: number): ListNode<T> | null
null if index is out of boundsunshift(...values: T[]): number
push(...values: T[]): number
insert(index: number, ...values: T[]): number
shift(): ListNode<T>
null if emptypop(): ListNode<T>
null if emptyremove(index: number): ListNode<T>
clear(): this
splice(start: number, end: number): List<T>
splice(start: number, end: number, list: List<T>, index: number): List<T>
fill(value: T): this
reverse(): this
copyWithin(start: number, end: number, target: number, targetEnd?: boolean): this
sort(callback): this
flat(depth?: number): this
slice(start?: number, end?: number): List<T>
includes(value: T, backwards?: boolean): boolean
true if value is contained in the listindexOf(value: T, backwards?: boolean): number
-1find(callback, self?, backwards?): ListNode<T>
truefindIndex(callback, self?, backwards?): number
truesome(callback, self?, backwards?): boolean
true if any node matches callbackevery(callback, self?, backwards?): boolean
true if all nodes match callbackreduce(callback, initialValue, self?, backwards?): U
filter(callback, self?, backwards?): this
truemap(callback, self?, backwards?): List<U>
forEach(callback, self?, backwards?): this
concat(...values: (T | List<T>)[]): List<T>
List with the given values appendednodes(): ListNode<T>[]
Array of all nodesvalues(): T[]
Array of all node valuestoString(): string
[Symbol.iterator](): Iterator<T>
FAQs
A double linked list class with an API similar to the Array class and a corresponding list node class.
We found that @dandre3000/list 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.