An open API service indexing awesome lists of open source software.

https://github.com/onesy-me/linked-list

Linked list
https://github.com/onesy-me/linked-list

browser javascript linked-list linkedlist nodejs typescript

Last synced: about 2 months ago
JSON representation

Linked list

Awesome Lists containing this project

README

        



onesy logo

onesy Linked list


Linked list



MIT license    
Production ready    
UMD 1.3kb gzipped    
100% test cov    
Browser and Nodejs


Very simple code    
Modern code    
Junior friendly    
Typescript    
Made with :yellow_heart:


## Getting started

### Add

```sh
yarn add @onesy/linked-list
```

### Use cases
- Implementation of stacks
- Efficient removal of elements
- Reduced memory fragmentation
- etc.

### Use

```javascript
import OnesyLinkedList from '@onesy/linked-list';

// Make a new linked list instance
const onesyLinkedList = new OnesyLinkedList();

// Add values
onesyLinkedList.add(1).add(4);

onesyLinkedList.first;
// 1

onesyLinkedList.last;
// 4

const value = onesyLinkedList.search(4);
// OnesyNode { value: 4, ... }

onesyLinkedList.remove(1);

onesyLinkedList.first;
// 4

onesyLinkedList.length;
// 1
```

### Dev

Install

```sh
yarn
```

Test

```sh
yarn test
```

### Prod

Build

```sh
yarn build
```