open-index/open-npm huggingface dataset:
npm package: @onestone/singleflight
Description: Ensure only one execution is in-flight for a given key at a time
Author: Peter Petrov
Latest version: 1.0.0

# @onestone/singleflight

A TypeScript utility that ensures only one execution of a function is in-flight for a given key at a time. If a duplicate call comes in while the original is still processing, the duplicate caller waits for the original to complete and receives the same results.

Inspired by the [singleflight](https://pkg.go.dev/golang.org/x/sync/singleflight) Go package.

## Installation

```bash
npm install @onestone/singleflight
```

## Usage

### Basic Usage

```typescript
import { Singleflight } from '@onestone/singleflight';

const sf = new Singleflight();

// Example function that simulates an expensive operation
async function fetchUserData(userId: string) {
    const result = await sf.do(`fetchUserData:${userId}`, async () => {
        // Your expensive operation here
        // Only one call for the same userId will execute at a time
        return await someExpensiveOperation(userId);
    });
    return result;
}
```

### Automatic Key Generation

```typescript
import { Singleflight } from '@onestone/singleflight';

const sf = new Singleflight();

async function fetchUserProfileImpl(userId: string, includeDetails: boolean) {
    return await someExpensiveOperation(userId, includeDetails);
}

async function fetchUserProfile(userId: string, includeDetails: boolean) {
    // The key is automatically generated based on function name and arguments
    return await sf.doAuto(fetchUserProfileImpl, userId, includeDetails);
}
```

## API

### `do<T>(key: KeyType, fn: Fn<T>): Promise<T>`

Executes and returns the results of the given function, making sure that only one execution is in-flight for a given key at a time.

- `key`: A unique identifier for this function execution (string, number, or symbol)
- `fn`: The async function to be executed

### `doAuto<T, Args extends unknown[]>(fn: ArgFn<T, Args>, ...args: Args)`

Executes a function and ensures only one execution is in-flight at a time, automatically generating a key based on the function name and its arguments.

- `fn`: The async function to be executed
- `args`: The arguments to pass to the function

## Features

- 🔒 Prevents duplicate in-flight requests
- 🚀 TypeScript support with full type safety
- 🎯 Automatic key generation based on function name and arguments
- 💡 Simple and intuitive API
- 🪶 Lightweight with zero dependencies

## License

MIT
npm package: @onesy/algorithms
Description: Algorithms
Author: Lazar
Latest version: 1.0.0


</br>
</br>

<p align='center'>
  <a target='_blank' rel='noopener noreferrer' href='#'>
    <img src='utils/images/logo.svg' alt='onesy logo' />
  </a>
</p>

<h1 align='center'>onesy Algorithms</h1>

<p align='center'>
  Algorithms
</p>

<br />

<h3 align='center'>
  <sub>MIT license&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>UMD 2.1kb gzipped&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Browser and Nodejs</sub>
</h3>

<p align='center'>
  <sub>Very simple code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Modern code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Junior friendly&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Typescript&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Made with :yellow_heart:</sub>
</p>

<br />

## Getting started

### Add

```sh
yarn add @onesy/algorithms
```

### Algorithms
- Factorial
- Fibonacci
- Binary search
- Bubble sort
- Selection sort
- Insertion sort
- Merge sort
- Quick sort
- Radix sort
- Naive search
- LPS
- KMP
- etc.

### Use

```javascript
  import { bubbleSort } from '@onesy/algorithms';

  const value = [1, 14, 7, 4];

  bubbleSort(value);

  // [1, 4, 7, 14]

  // etc.
```

### Dev

Install

```sh
yarn
```

Test

```sh
yarn test
```

### Prod

Build

```sh
yarn build
```
npm package: @onesy/amqp
Description: AMQP
Author: Lazar
Latest version: 1.0.0


</br>
</br>

<p align='center'>
  <a target='_blank' rel='noopener noreferrer' href='#'>
    <img src='utils/images/logo.svg' alt='onesy logo' />
  </a>
</p>

<h1 align='center'>onesy AMQP</h1>

<p align='center'>
  AMQP
</p>

<br />

<h3 align='center'>
  <sub>MIT license&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Nodejs</sub>
</h3>

<p align='center'>
    <sub>Very simple code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Modern code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Junior friendly&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Typescript&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Made with :yellow_heart:</sub>
</p>

<br />

## Getting started

### Add

```sh
yarn add @onesy/amqp
```

Add `amqplib` peer dependency.

```sh
yarn add amqplib
```

### Use

```javascript
  import OnesyAmqp from '@onesy/amqp';
  // Make if you wanna a config file and
  // inside of it add all the process.env related props
  import Config from './config';

  // Make a new amqp instance
  const onesyAmqp = new OnesyAmqp({
    uri: Config.amqp.rabbitmq.uri,
    queues: Config.amqp.rabbitmq.queues,
    exchanges: Config.amqp.rabbitmq.exchanges,
  });

  // Await for a channel
  await onesyAmqp.channel;

  // Send to a queue
  await onesyAmqp.send('a', 'a');

  // Check a queue
  await onesyAmqp.checkQueue();

  // { queue: 'a', messageCount: 1, etc. }
```

### Dev


Install

```sh
yarn
```

Test

```sh
yarn test
```

One time local setup

Install docker and docker-compose

  - https://docs.docker.com/get-docker
  - https://docs.docker.com/compose/install

Make docker containers

```sh
yarn docker
```

### Prod

Build

```sh
yarn build
```
npm package: @onesy/apis
Description: API
Author: Lazar
Latest version: 1.0.1


</br>
</br>

<p align='center'>
  <a target='_blank' rel='noopener noreferrer' href='#'>
    <img src='utils/images/logo.svg' alt='onesy logo' />
  </a>
</p>

<h1 align='center'>onesy API</h1>

<p align='center'>
  API
</p>

<br />

<h3 align='center'>
  <sub>MIT license&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Nodejs</sub>
</h3>

<p align='center'>
    <sub>Very simple code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Modern code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Junior friendly&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Typescript&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Made with :yellow_heart:</sub>
</p>

<br />

## Getting started

### Add

```sh
yarn add @onesy/api
```

### Use

```javascript
  import express from 'express';
  import { Route, Method, IRouteClassInstance, Routes } from '@onesy/api';

  class Base implements IRouteClassInstance {

    public response(req: express.Request, response: express.Response, options: { method: 'json' | 'send', type: 'application/json', }) { return ...; }

    public error(req: express.Request, error: Error) { return ...; }

  }

  // Add decorator to a class representing a route
  @Route(
    '/a',
    method
  )
  class A extends Base {

    @Method(
      'get',
      '/a',
      method1
    )
    public a() { }

  }

  // Create an express app
  const app = express();

  // Register all classes as app routes
  Routes([A], app);

  // app routes:
  // GET /a/a, middlewares: method, method1

  // etc.
```

### Dev

Install

```sh
yarn
```

Test

```sh
yarn test
```

### Prod

Build

```sh
yarn build
```
npm package: @onesy/aws
Description: AWS utils
Author: Lazar
Latest version: 1.0.0


</br>
</br>

<p align='center'>
  <a target='_blank' rel='noopener noreferrer' href='#'>
    <img src='utils/images/logo.svg' alt='onesy logo' />
  </a>
</p>

<h1 align='center'>onesy AWS</h1>

<p align='center'>
  AWS
</p>

<br />

<h3 align='center'>
  <sub>MIT license&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Nodejs</sub>
</h3>

<p align='center'>
    <sub>Very simple code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Modern code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Junior friendly&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Typescript&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Made with :yellow_heart:</sub>
</p>

<br />

## Getting started

### Add

```sh
yarn add @onesy/aws
```

Add `@aws-sdk/client-s3` peer dependency.

```sh
yarn add @aws-sdk/client-s3
```

### Use

```javascript
  import OnesyAws from '@onesy/aws';

  // Make if you wanna a config file and
  // inside of it add all the process.env related props
  import Config from './config';

  // Make a new aws instance
  const onesyAws = new OnesyAws({
    s3: {
      bucketName: Config.aws.s3.bucketName,

      credentials: {
        accessKeyId: Config.aws.s3.accessKeyId,
        secretAccessKey: Config.aws.s3.secretAccessKey
      },

      endpoint: Config.aws.s3.endpoint,

      region: Config.aws.s3.region
    }
  });

  // Add
  await onesyAws.s3.add('a', 4);

  // Get
  await onesyAws.s3.get('a');

  // 4

  // Remove
  await onesyAws.s3.remove('a');

  await onesyAws.s3.get('a');

  // undefined
```

### Dev

Install

```sh
yarn
```

Test

```sh
yarn test
```

#### One time local setup

Install docker and docker-compose

  - https://docs.docker.com/get-docker
  - https://docs.docker.com/compose/install

Install aws

  - https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html

Make docker containers

```sh
yarn docker
```

### Prod

Build

```sh
yarn build
```
npm package: @onesy/binary-tree
Description: Binary tree
Author: Lazar
Latest version: 1.0.0


</br>
</br>

<p align='center'>
  <a target='_blank' rel='noopener noreferrer' href='#'>
    <img src='utils/images/logo.svg' alt='onesy logo' />
  </a>
</p>

<h1 align='center'>onesy Binary Tree</h1>

<p align='center'>
  Binary Tree
</p>

<br />

<h3 align='center'>
  <sub>MIT license&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>UMD 1.9kb gzipped&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Browser and Nodejs</sub>
</h3>

<p align='center'>
  <sub>Very simple code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Modern code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Junior friendly&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Typescript&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Made with :yellow_heart:</sub>
</p>

<br />

## Getting started

### Add

```sh
yarn add @onesy/binary-tree
```

### Use cases
- Min/max heaps
- Huffman coding, data compression
- Machine learning, making decisions
- etc.

### Use

```javascript
  import { OnesyBinaryTree } from '@onesy/binary-tree';

  // Make a new binary tree instance
  const onesyBinaryTree = new OnesyBinaryTree();

  // Add a onesy node / value
  [4, 2, 7, 14, 1, 3, 5].map(value => onesyBinaryTree.add(value));

  // or use a make method or a static method
  onesyBinaryTree.make([4, 2, 7, 14, 1, 3, 5]);

  // Binary tree
         4
       /   \
      /     \
     2       7
    / \     / \
   1   3   5   14

  // Remove any value
  onesyBinaryTree.remove(2);

  // Binary tree
         4
       /   \
      /     \
     3       7
    /       / \
   1       5   14
```

### Dev

Install

```sh
yarn
```

Test

```sh
yarn test
```

### Prod

Build

```sh
yarn build
```
npm package: @onesy/cache
Description: Cache
Author: Lazar
Latest version: 1.0.0


</br>
</br>

<p align='center'>
  <a target='_blank' rel='noopener noreferrer' href='#'>
    <img src='utils/images/logo.svg' alt='onesy logo' />
  </a>
</p>

<h1 align='center'>onesy Cache</h1>

<p align='center'>
  Cache
</p>

<br />

<h3 align='center'>
  <sub>MIT license&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>UMD 4.2kb gzipped&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Browser and Nodejs</sub>
</h3>

<p align='center'>
    <sub>Very simple code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Modern code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Junior friendly&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Typescript&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Made with :yellow_heart:</sub>
</p>

<br />

## Getting started

### Add

```sh
yarn add @onesy/cache
```

### Use

```javascript
  import OnesyCache from '@onesy/cache';

  const args = [4, { a: 4, ab: 4 }];

  // Args is made into a hash, which makes the key
  // a very useful, when you wanna cache a value based
  // on some complex amount of variables
  OnesyCache.add(4, ...args);

  OnesyCache.get(...args);

  // Output
  // 4
```

### Dev

Install

```sh
yarn
```

Test

```sh
yarn test
```

### Prod

Build

```sh
yarn build
```
npm package: @onesy/cookie
Description: Cookie
Author: Lazar
Latest version: 1.0.0


</br>
</br>

<p align='center'>
  <a target='_blank' rel='noopener noreferrer' href='#'>
    <img src='utils/images/logo.svg' alt='onesy logo' />
  </a>
</p>

<h1 align='center'>onesy Cookie</h1>

<p align='center'>
  Cookie
</p>

<br />

<h3 align='center'>
  <sub>MIT license&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>UMD 4.6kb gzipped&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Browser</sub>
</h3>

<p align='center'>
    <sub>Very simple code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Modern code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Junior friendly&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Typescript&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Made with :yellow_heart:</sub>
</p>

<br />

## Getting started

### Add

```sh
yarn add @onesy/cookie
```

### Use

```javascript
  import OnesyCookie from '@onesy/cookie';

  const onesyCookie = new OnesyCookie();

  // Add
  onesyCookie.add('a', 4);

  // Has
  onesyCookie.has('a');

  // true

  // Get
  onesyCookie.get('a');

  // 4

  // Remove
  onesyCookie.remove('a');

  onesyCookie.get('a');

  // undefined
```

### Dev

Install

```sh
yarn
```

Test

```sh
yarn test
```

### Prod

Build

```sh
yarn build
```
npm package: @onesy/date
Description: Time and date utils library
Author: Lazar
Latest version: 1.0.2


</br>
</br>

<p align='center'>
  <a target='_blank' rel='noopener noreferrer' href='#'>
    <img src='utils/images/logo.svg' alt='onesy logo' />
  </a>
</p>

<h1 align='center'>onesy Date</h1>

<p align='center'>
  Time and date utils library
</p>

<br />

<h3 align='center'>
  <sub>MIT license&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>min 2.4kb gzipped&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Tree shakable&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Browser and Nodejs</sub>
</h3>

<p align='center'>
    <sub>Very simple code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Modern code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Junior friendly&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Typescript&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Made with :yellow_heart:</sub>
</p>

<br />

#### Sizes

<sup>OnesyDate <b>2.4kb gzipped</b></sup> <br />
<sup>OnesyDate with all the methods <b>5.6kb gzipped</b></sup>  <br />
<sup>OnesyDate with all the methods and all the timezones <b>22kb gzipped</b></sup>

## Getting started

### Add

```sh
yarn add @onesy/date
```

### Use

```javascript
  import { OnesyDate, format } from '@onesy/date';

  // Make a new OnesyDate instance
  // with an optional initial value
  const onesyDate = new OnesyDate('2014-04-14T14:04:14.147');

  // Value
  onesyDate.value;

  // a Date instance, Mon Apr 14 2014 14:04:14 GMT+0200 (Central European Summer Time)

  // Format
  // with various ways to add regular text and variables
  format(onesyDate, `MM-DD-YYYY '🙂' HH:mm:ss.SSS`);

  // '04-14-2014 🙂 14:04:14.147'
```

### Dev

Install

```sh
yarn
```

Test

```sh
yarn test
```

### Prod

Build

```sh
yarn build
```
npm package: @onesy/diff
Description: Diff algorithm
Author: Lazar
Latest version: 1.0.1


</br>
</br>

<p align='center'>
  <a target='_blank' rel='noopener noreferrer' href='#'>
    <img src='utils/images/logo.svg' alt='onesy logo' />
  </a>
</p>

<h1 align='center'>onesy Diff</h1>

<p align='center'>
  Own implementation of The Myers Difference Algorithm
</p>

<br />

<h3 align='center'>
  <sub>MIT license&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>UMD 3.1kb gzipped&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Browser and Nodejs</sub>
</h3>

<p align='center'>
    <sub>Very simple code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Modern code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Junior friendly&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Typescript&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Made with :yellow_heart:</sub>
</p>

<br />

## Getting started

### Add

```sh
yarn add @onesy/diff
```

### Use

```javascript
  import OnesyDiff from '@onesy/diff';

  // Make a new OnesyDiff instance
  // with an optional initial value for options
  const onesyDiff = new OnesyDiff();

  // Diff
  const diff = onesyDiff.diff('aaa', 'aab');

  // {
  //   items: ['r', 2, 'a', 2, 'b']
  // }

  // Update
  onesyDiff.update('aaa', diff);

  // 'aab'
```

### Dev

Install

```sh
yarn
```

Test

```sh
yarn test
```

### Prod

Build

```sh
yarn build
```
npm package: @onesy/errors
Description: Errors
Author: Lazar
Latest version: 1.0.0


</br>
</br>

<p align='center'>
  <a target='_blank' rel='noopener noreferrer' href='#'>
    <img src='utils/images/logo.svg' alt='onesy logo' />
  </a>
</p>

<h1 align='center'>onesy Errors</h1>

<p align='center'>
  Errors
</p>

<br />

<h3 align='center'>
  <sub>MIT license&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>UMD 0.8kb gzipped&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Browser and Nodejs</sub>
</h3>

<p align='center'>
    <sub>Very simple code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Modern code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Junior friendly&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Typescript&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Made with :yellow_heart:</sub>
</p>

<br />

## Getting started

### Add

```sh
yarn add @onesy/errors
```

### Use

```javascript
  import { OnesyError } from '@onesy/errors';
  import OnesyLog from '@onesy/log';

  const onesyError = new OnesyError('a');

  onesyError.name;
  onesyError.message;
  onesyError.added_at;
  onesyError.stack;

  // OnesyError
  // 'a'
  // 1643893234
  // 'OnesyError: a\n    at eval (eval at evaluate (:3:2389), <anonymous>:2:31)\n    at t.default.evaluate (<anonymous>:3:2412)\n    at t.default.<anonymous> (<anonymous>:1:44)'

  OnesyLog.error(onesyError);

  // Output

    // 04-04-2014 04:04:14.141 (error):

    // a

    // OnesyError: a
    //    at eval (eval at evaluate (:3:2389), <anonymous>:2:31)
    //    at t.default.evaluate (<anonymous>:3:2412)
    //    at t.default.<anonymous> (<anonymous>:1:44)

```

### Dev

Install

```sh
yarn
```

Test

```sh
yarn test
```

### Prod

Build

```sh
yarn build
```
npm package: @onesy/graph
Description: Graph
Author: Lazar
Latest version: 1.0.0


</br>
</br>

<p align='center'>
  <a target='_blank' rel='noopener noreferrer' href='#'>
    <img src='utils/images/logo.svg' alt='onesy logo' />
  </a>
</p>

<h1 align='center'>onesy Graph</h1>

<p align='center'>
  Graph
</p>

<br />

<h3 align='center'>
  <sub>MIT license&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>UMD 2.2kb gzipped&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Browser and Nodejs</sub>
</h3>

<p align='center'>
  <sub>Very simple code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Modern code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Junior friendly&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Typescript&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Made with :yellow_heart:</sub>
</p>

<br />

## Getting started

### Add

```sh
yarn add @onesy/graph
```

### Use cases
- Social media network
- Maps, roads connections, GPS
- Search result relevancy algorithm
- etc.

### Use

```javascript
  import OnesyGraph from '@onesy/graph';

  // Make a new graph instance
  const onesyGraph = new OnesyGraph({ weighted: true });

  // Add nodes
  onesyGraph
    .addNode('a')
    .addNode('b')
    .addNode('c')
    .addNode('d')
    .addNode('e')
    .addNode('f')
    .addNode('g');

  // Add connections
  onesyGraph
    .addConnection('a', 'b', 2)
    .addConnection('a', 'c', 7)
    .addConnection('b', 'd', 5)
    .addConnection('c', 'd', 7)
    .addConnection('d', 'e', 14)
    .addConnection('d', 'f', 11)
    .addConnection('e', 'f', 4)
    .addConnection('f', 'g', 2)
    .addConnection('e', 'g', 4);

  // matrix
  onesyGraph.array;

  // [
  //      a  b  c  d  e  f  g
  //   a [0, 2, 7, 0, 0, 0, 0],
  //   b [2, 0, 0, 5, 0, 0, 0],
  //   c [7, 0, 0, 7, 0, 0, 0],
  //   d [0, 5, 7, 0, 14, 11, 0],
  //   e [0, 0, 0, 14, 0, 4, 4],
  //   f [0, 0, 0, 11, 4, 0, 2],
  //   g [0, 0, 0, 0, 4, 2, 0]
  // ]

  // Shortest path
  onesyGraph.shortestPath('a', 'g');

  // {
  //   distance: 20,
  //   path: 'a-b-d-f-g'
  // }
```

### Dev

Install

```sh
yarn
```

Test

```sh
yarn test
```

### Prod

Build

```sh
yarn build
```
npm package: @onesy/hash-table
Description: Hash table
Author: Lazar
Latest version: 1.0.0


</br>
</br>

<p align='center'>
  <a target='_blank' rel='noopener noreferrer' href='#'>
    <img src='utils/images/logo.svg' alt='onesy logo' />
  </a>
</p>

<h1 align='center'>onesy Hash table</h1>

<p align='center'>
  Hash table
</p>

<br />

<h3 align='center'>
  <sub>MIT license&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>UMD 1.5kb gzipped&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Browser and Nodejs</sub>
</h3>

<p align='center'>
  <sub>Very simple code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Modern code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Junior friendly&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Typescript&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Made with :yellow_heart:</sub>
</p>

<br />

## Getting started

### Add

```sh
yarn add @onesy/hash-table
```

### Use cases
- Indexing data
- Caching
- Storage for data, for efficient quering
- Storing relationships between data
- etc.

### Use

```javascript
  import OnesyHashTable from '@onesy/hash-table';

  // Make a new hash table instance
  const onesyHashTable = new OnesyHashTable();

  // Add values
  onesyHashTable.set('a', 14).set('a1', 114);

  onesyHashTable.get('a');
  // 14

  onesyHashTable.get('a14');
  // undefined

  // Remove
  onesyHashTable.remove('a');
  // true

  onesyHashTable.get('a');
  // undefined
```

### Dev

Install

```sh
yarn
```

Test

```sh
yarn test
```

### Prod

Build

```sh
yarn build
```
npm package: @onesy/heap
Description: Min/Max Heap
Author: Lazar
Latest version: 1.0.0


</br>
</br>

<p align='center'>
  <a target='_blank' rel='noopener noreferrer' href='#'>
    <img src='utils/images/logo.svg' alt='onesy logo' />
  </a>
</p>

<h1 align='center'>onesy Heap</h1>

<p align='center'>
  Min/Max Heap
</p>

<br />

<h3 align='center'>
  <sub>MIT license&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>UMD 2kb gzipped&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Browser and Nodejs</sub>
</h3>

<p align='center'>
  <sub>Very simple code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Modern code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Junior friendly&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Typescript&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Made with :yellow_heart:</sub>
</p>

<br />

## Getting started

### Add

```sh
yarn add @onesy/heap
```

### Use cases
- Priority queues
- Schedulers
- etc.

### Use

```javascript
  import { OnesyHeap } from '@onesy/heap';

  // Make a new heap instance
  // with an optional initial value a variant (min or max)
  // a min heap as a default value
  const onesyMinHeap = new OnesyHeap();

  // Add a onesy node / value
  onesyMinHeap.add(4);

  // You can also make a heap from array of values
  onesyMinHeap.make([4, 44, 54, 14, 31, 37, 24]);

  // values
         4
        /  \
       /    \
     14      24
     / \     / \
   44   31 37   54

  // Remove priority min (first) value
  onesyMinHeap.remove();

  // 4

  // values
         14
        /  \
       /    \
     31      24
     / \     /
   44   54 37
```

### Dev

Install

```sh
yarn
```

Test

```sh
yarn test
```

### Prod

Build

```sh
yarn build
```
npm package: @onesy/icons-material-rounded-react
Description: Icons material rounded for React
Author: Lazar Erić
Latest version: 1.0.11


</br>
</br>

<p align='center'>
  <a target='_blank' rel='noopener noreferrer' href='#'>
    <img src='../../utils/images/logo.svg' alt='onesy logo' />
  </a>
</p>

<h1 align='center'>onesy Icons Material Rounded React</h1>

<p align='center'>
  Onesy Icons Material Rounded for React <br />
  11k+ icon versions including 100, 400 weights, with and without the fill
</p>

<br />

<h3 align='center'>
  <sub>MIT license&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Browser and Nodejs</sub>
</h3>

<p align='center'>
  <sub>Very simple code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Modern code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Junior friendly&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Typescript&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Made with :yellow_heart:</sub>
</p>

<br />

### Add

```sh
yarn add @onesy/icons-material-react
```

### Use

```javascript
  // Import any of the icons
  // best to import them as modules like this example
  // it's the most efficient way to import icons
  import IconMaterialPottedPlantRounded from '@onesy/icons-material-rounded-react/IconMaterialPottedPlant';

  function A(props) {

    return (
      // 🪴
      <IconMaterialPottedPlantRounded />
    );
  }
```

### Dev

Install

```sh
yarn
```

Test

```sh
yarn test
```

### Prod

Build

```sh
yarn build
```

### Licenses

[Google material design icons](https://fonts.google.com/icons) are ones used in this repository, licenced under their own [licence](https://github.com/google/material-design-icons/blob/master/LICENSE).

Updates made to original icons:
- A part of the icons are used not all of them.
- Inner svg elements (children) are extracted from every icon, and put within the @onesy/ui-react Icon component as children.
- Every icon from there is made into it's own React component as part of this UI library.
npm package: @onesy/icons-material-sharp-react
Description: Icons material sharp for React
Author: Lazar Erić
Latest version: 1.0.11


</br>
</br>

<p align='center'>
  <a target='_blank' rel='noopener noreferrer' href='#'>
    <img src='../../utils/images/logo.svg' alt='onesy logo' />
  </a>
</p>

<h1 align='center'>onesy Icons Material Sharp React</h1>

<p align='center'>
  Onesy Icons Material Sharp for React <br />
  11k+ icon versions including 100, 400 weights, with and without the fill
</p>

<br />

<h3 align='center'>
  <sub>MIT license&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Browser and Nodejs</sub>
</h3>

<p align='center'>
  <sub>Very simple code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Modern code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Junior friendly&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Typescript&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Made with :yellow_heart:</sub>
</p>

<br />

### Add

```sh
yarn add @onesy/icons-material-react
```

### Use

```javascript
  // Import any of the icons
  // best to import them as modules like this example
  // it's the most efficient way to import icons
  import IconMaterialPottedPlantSharp from '@onesy/icons-material-sharp-react/IconMaterialPottedPlant';

  function A(props) {

    return (
      // 🪴
      <IconMaterialPottedPlantSharp />
    );
  }
```

### Dev

Install

```sh
yarn
```

Test

```sh
yarn test
```

### Prod

Build

```sh
yarn build
```

### Licenses

[Google material design icons](https://fonts.google.com/icons) are ones used in this repository, licenced under their own [licence](https://github.com/google/material-design-icons/blob/master/LICENSE).

Updates made to original icons:
- A part of the icons are used not all of them.
- Inner svg elements (children) are extracted from every icon, and put within the @onesy/ui-react Icon component as children.
- Every icon from there is made into it's own React component as part of this UI library.
npm package: @onesy/icons-material-two-tone-react
Description: Icons material two tone for React
Author: Lazar Erić
Latest version: 1.0.11


</br>
</br>

<p align='center'>
  <a target='_blank' rel='noopener noreferrer' href='#'>
    <img src='../../utils/images/logo.svg' alt='onesy logo' />
  </a>
</p>

<h1 align='center'>onesy Icons Material Two Tone React</h1>

<p align='center'>
  Onesy Icons Material Two Tone for React <br />
  11k+ icon versions including 100, 400 weights, with and without the fill
</p>

<br />

<h3 align='center'>
  <sub>MIT license&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Browser and Nodejs</sub>
</h3>

<p align='center'>
  <sub>Very simple code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Modern code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Junior friendly&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Typescript&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Made with :yellow_heart:</sub>
</p>

<br />

### Add

```sh
yarn add @onesy/icons-material-react
```

### Use

```javascript
  // Import any of the icons
  // best to import them as modules like this example
  // it's the most efficient way to import icons
  import IconMaterialPottedPlantTwoTone from '@onesy/icons-material-two-tone-react/IconMaterialPottedPlant';

  function A(props) {

    return (
      // 🪴
      <IconMaterialPottedPlantTwoTone />
    );
  }
```

### Dev

Install

```sh
yarn
```

Test

```sh
yarn test
```

### Prod

Build

```sh
yarn build
```

### Licenses

[Google material design icons](https://fonts.google.com/icons) are ones used in this repository, licenced under their own [licence](https://github.com/google/material-design-icons/blob/master/LICENSE).

Updates made to original icons:
- A part of the icons are used not all of them.
- Inner svg elements (children) are extracted from every icon, and put within the @onesy/ui-react Icon component as children.
- Every icon from there is made into it's own React component as part of this UI library.
npm package: @onesy/linked-list
Description: Linked list
Author: Lazar
Latest version: 1.0.0


</br>
</br>

<p align='center'>
  <a target='_blank' rel='noopener noreferrer' href='#'>
    <img src='utils/images/logo.svg' alt='onesy logo' />
  </a>
</p>

<h1 align='center'>onesy Linked list</h1>

<p align='center'>
  Linked list
</p>

<br />

<h3 align='center'>
  <sub>MIT license&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>UMD 1.3kb gzipped&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Browser and Nodejs</sub>
</h3>

<p align='center'>
  <sub>Very simple code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Modern code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Junior friendly&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Typescript&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Made with :yellow_heart:</sub>
</p>

<br />

## 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
```
npm package: @onesy/log
Description: Log utils, very readable and clean logs
Author: Lazar Erić
Latest version: 1.0.3


</br>
</br>

<p align='center'>
  <a target='_blank' rel='noopener noreferrer' href='#'>
    <img width='auto' height='84' src='https://raw.githubusercontent.com/onesy-me/onesy/refs/heads/main/utils/images/logo.png' alt='onesy logo' />
  </a>
</p>

<h1 align='center'>onesy Log</h1>

<h3 align='center'>
  <sub>MIT license&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>UMD 7.2kb gzipped&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Browser and Nodejs</sub>
</h3>

<p align='center'>
    <sub>Very simple code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Modern code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Junior friendly&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Typescript&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Made with :yellow_heart:</sub>
</p>

<br />

### Add

```sh
yarn add @onesy/log
```

### Use

```javascript
  import OnesyLog from '@onesy/log';

  // Make a new log instance
  // with an optional options value
  const onesyLog = new OnesyLog({
    arguments: {
      pre: [
        'Mongo',
      ],
    },
  });

  // Log any array of values
  onesyLog.info(`Collection: A`, `Response: 40ms`);

  // Output

    // 04-04-2014 04:04:14.141 (info):

    // Mongo
    // Collection: A
    // Response: 40ms

```

### Dev

Install

```sh
yarn
```

Test

```sh
yarn test
```

### Prod

Build

```sh
yarn build
```
npm package: @onesy/meta
Description: Meta
Author: Lazar
Latest version: 1.0.0


</br>
</br>

<p align='center'>
  <a target='_blank' rel='noopener noreferrer' href='#'>
    <img src='utils/images/logo.svg' alt='onesy logo' />
  </a>
</p>

<h1 align='center'>onesy Meta</h1>

<p align='center'>
  Meta
</p>

<br />

<h3 align='center'>
  <sub>MIT license&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>UMD 1.9kb gzipped&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Browser and Nodejs</sub>
</h3>

<p align='center'>
    <sub>Very simple code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Modern code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Junior friendly&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Typescript&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Made with :yellow_heart:</sub>
</p>

<br />

## Getting started

### Add

```sh
yarn add @onesy/meta
```

### Use

```javascript
  import OnesyMeta from '@onesy/meta';

  const object = {};

  OnesyMeta.add('a', 'a', object);
  OnesyMeta.add('a', 'a4', object, 'p');

  OnesyMeta.get('a', object);
  OnesyMeta.get('a', object, 'p');

  // Output
  // 'a'
  // 'a4'
```

### Dev

Install

```sh
yarn
```

Test

```sh
yarn test
```

### Prod

Build

```sh
yarn build
```
npm package: @onesy/models
Description: Models
Author: Lazar Erić
Latest version: 1.0.1


</br>
</br>

<p align='center'>
  <a target='_blank' rel='noopener noreferrer' href='#'>
    <img width='auto' height='84' src='https://raw.githubusercontent.com/onesy-me/onesy/refs/heads/main/utils/images/logo.png' alt='onesy logo' />
  </a>
</p>

<h1 align='center'>onesy Models</h1>

<h3 align='center'>
  <sub>MIT license&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>UMD 4.2kb gzipped&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Browser and Nodejs</sub>
</h3>

<p align='center'>
    <sub>Very simple code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Modern code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Junior friendly&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Typescript&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Made with :yellow_heart:</sub>
</p>

<br />

### Add

```sh
yarn add @onesy/models 
```

### Use

```javascript
  import express from 'express';
  import { Query, Response } from '@onesy/models';

  async function route(req: express.Request, res: express.Response) {
    const query = Query.fromRequest(req);

    const response = await todoCollection.searchMany(query);

    return res.status(200).json(Response.fromQuery(response));
  }

  // etc.
```

### Dev

Install

```sh
yarn
```

Test

```sh
yarn test
```

### Prod

Build

```sh
yarn build
```
npm package: @onesy/mongo
Description: Utils for easier using of mongodb library.
Author: Lazar Erić
Latest version: 1.0.4


</br>
</br>

<p align='center'>
  <a target='_blank' rel='noopener noreferrer' href='#'>
    <img width='auto' height='84' src='https://raw.githubusercontent.com/onesy-me/onesy/refs/heads/main/utils/images/logo.png' alt='onesy logo' />
  </a>
</p>

<h1 align='center'>onesy Mongo</h1>

<h3 align='center'>
  <sub>MIT license&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Nodejs</sub>
</h3>

<p align='center'>
    <sub>Very simple code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Modern code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Junior friendly&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Typescript&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Made with :yellow_heart:</sub>
</p>

<br />

### Add

```sh
yarn add @onesy/mongo
```

Add `mongodb` as a peer dependency

```sh
yarn add mongodb
```

### Use

```javascript
  import { Mongo, BaseCollection } from '@onesy/mongo';
  // Make if you wanna a config file and
  // inside of it add all the process.env related props
  import Config from './config';

  // Make a new mongo instance
  const mongo = new Mongo({
    uri: Config.db.mongo.uri,
    name: Config.db.mongo.name,
  });

  await mongo.connection;

  // Make a collection class
  class TodoCollection extends BaseCollection {

    public constructor() {
      super('todos', mongo);
    }

  }

  const todoCollection = new TodoCollection();

  // Add
  const todoCreated = await todoCollection.addOne({
    name: 'todo',
    description: 'description'
  });

  // Find one
  const todo = await aCollection.findOne({
    _id: todoCreated._id
  });

  todo;

  // {
  //   _id: ObjectId('407f191e810c19729de860ea'),
  //   name: 'todo',
  //   description: 'description',
  //   added_at: 1777044477
  // }

  // etc.
```

### Dev

Install

```sh
yarn
```

Test

```sh
yarn test
```

#### One time local setup

Install docker and docker-compose

  - https://docs.docker.com/get-docker
  - https://docs.docker.com/compose/install

Make docker containers

```sh
yarn docker
```

(mac) Add lines below to */private/etc/hosts*
```
127.0.0.1   mongo1
127.0.0.1   mongo2
127.0.0.1   mongo3
127.0.0.1   mongo1-test
127.0.0.1   mongo2-test
127.0.0.1   mongo3-test
```

### Prod

Build

```sh
yarn build
```
npm package: @onesy/node
Description: Nodejs utils
Author: Lazar
Latest version: 1.0.0


</br>
</br>

<p align='center'>
  <a target='_blank' rel='noopener noreferrer' href='#'>
    <img src='utils/images/logo.svg' alt='onesy logo' />
  </a>
</p>

<h1 align='center'>onesy Node</h1>

<p align='center'>
  Node
</p>

<br />

<h3 align='center'>
  <sub>MIT license&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Nodejs</sub>
</h3>

<p align='center'>
    <sub>Very simple code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Modern code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Junior friendly&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Typescript&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Made with :yellow_heart:</sub>
</p>

<br />

## Getting started

### Add

```sh
yarn add @onesy/node
```

### Use

```javascript
  import path from 'path';

  import OnesyNode from '@onesy/node';

  // A file add
  await OnesyNode.file.add(path.resolve('a.json'), 'a');

  // A file read
  await OnesyNode.file.get(path.resolve('a.json'));

  // A file remove
  await OnesyNode.file.remove(path.resolve('a.json'));
```

### Dev

Install

```sh
yarn
```

Test

```sh
yarn test
```

### Prod

Build

```sh
yarn build
```
npm package: @onesy/queue
Description: Queue
Author: Lazar
Latest version: 1.0.0


</br>
</br>

<p align='center'>
  <a target='_blank' rel='noopener noreferrer' href='#'>
    <img src='utils/images/logo.svg' alt='onesy logo' />
  </a>
</p>

<h1 align='center'>onesy Queue</h1>

<p align='center'>
  Queue
</p>

<br />

<h3 align='center'>
  <sub>MIT license&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>UMD 1.5kb gzipped&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Browser and Nodejs</sub>
</h3>

<p align='center'>
  <sub>Very simple code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Modern code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Junior friendly&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Typescript&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Made with :yellow_heart:</sub>
</p>

<br />

## Getting started

### Add

```sh
yarn add @onesy/queue
```

### Use cases
- First come, first serve, use cases
- CPU Scheduling
- Memory management
- Website requests handling on the server
- Routers and switches in networking
- etc.

### Use

```javascript
  import OnesyQueue from '@onesy/queue';

  // Make a new queue instance
  const onesyQueue = new OnesyQueue();

  // Add values
  onesyQueue.push(1, 2, 3, 4);

  onesyQueue.first;
  // 1

  onesyQueue.length;
  // 4

  const value = onesyQueue.pop();

  value;
  // 1

  onesyQueue.first;
  // 2

  onesyQueue.length;
  // 3
```

### Dev

Install

```sh
yarn
```

Test

```sh
yarn test
```

### Prod

Build

```sh
yarn build
```
npm package: @onesy/redis
Description: Redis
Author: Lazar
Latest version: 1.0.5


</br >
</br >

<p align='center'>
  <a target='_blank' rel='noopener noreferrer' href='#'>
    <img src='utils/images/logo.svg' alt='onesy logo' />
  </a>
</p>

<h1 align='center'>onesy Redis</h1>

<p align='center'>
  Redis
</p>

<br />

<h3 align='center'>
  <sub>MIT license&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Nodejs</sub>
</h3>

<p align='center'>
    <sub>Very simple code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Modern code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Junior friendly&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Typescript&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Made with :yellow_heart:</sub>
</p>

<br />

## Getting started

### Add

```sh
  yarn add @onesy/redis
```

Add `redis` peer dependency.

```sh
  yarn add redis
```

### Use

```javascript
  import OnesyRedis from '@onesy/redis';
  // Make if you wanna a config file and
  // inside of it add all the process.env related props
  import Config from './config';

  // Make a new amqp instance
  const onesyRedis = new OnesyRedis({
    uri: Config.amqp.redis.uri
  });

  // Await for a client connection
  await onesyRedis.client;

  // Send to a queue
  await onesyRedis.publish('a', 'a'); 
```

### Dev


Install

```sh
  yarn
```

Test

```sh
  yarn test
```

One time local setup

Install docker and docker-compose

  - https://docs.docker.com/get-docker
  - https://docs.docker.com/compose/install

Make docker containers

```sh
  yarn docker
```

### Prod

Build

```sh
  yarn build
```
npm package: @onesy/request
Description: Requests client for browser and nodejs
Author: Lazar
Latest version: 1.0.2


</br>
</br>

<p align='center'>
  <a target='_blank' rel='noopener noreferrer' href='#'>
    <img src='utils/images/logo.svg' alt='onesy logo' />
  </a>
</p>

<h1 align='center'>onesy Request</h1>

<p align='center'>
  Request
</p>

<br />

<h3 align='center'>
  <sub>MIT license&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>UMD 18.1kb gzipped&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Browser and Nodejs</sub>
</h3>

<p align='center'>
    <sub>Very simple code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Modern code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Junior friendly&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Typescript&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Made with :yellow_heart:</sub>
</p>

<br />

## Getting started

### Add

```sh
yarn add @onesy/request
```

### Use

```javascript
  import OnesyRequest from '@onesy/request';

  // Make a new OnesyRequest instance
  const onesyRequest = new OnesyRequest();

  await onesyRequest.get('https://jsonplaceholder.typicode.com/posts/4');

  // or as a static method without a new instance
  await OnesyRequest.get('https://jsonplaceholder.typicode.com/posts/4');

  // {
  //     response: {
  //         userId: 1,
  //         id: 4,
  //         title: 'eum et est occaecati',
  //         body: 'ullam et saepe reiciendis voluptatem adipisci\nsit amet autem assumenda provident rerum culpa\nquis hic commodi nesciunt rem tenetur doloremque ipsam iure\nquis sunt voluptatem rerum illo velit'
  //     },
  //     status: 200,
  //     headers: {
  //         cache-control: 'max-age=43200',
  //         content-type: 'application/json; charset=utf-8',
  //         expires: -1,
  //         pragma: 'no-cache'
  //     },
  //     request: {
  //         headers: {
  //             Accept: 'application/json, text/plain, */*'
  //         }
  //     },
  //     options: {
  //         method: 'GET',
  //         url: 'https://jsonplaceholder.typicode.com/posts/4',
  //         request: {
  //             headers: {
  //                 Accept: 'application/json, text/plain, */*'
  //             },
  //             csrf: {
  //                 cookie: 'CSRF-TOKEN',
  //                 headers: 'X-CSRF-TOKEN'
  //             }
  //         },
  //         response: {
  //             resolveOnError: true,
  //             type: 'json',
  //             parse: {
  //                 json: true
  //             }
  //         }
  //     }
  // }
```

### Dev

Install

```sh
yarn
```

Test

```sh
yarn test
```

### Prod

Build

```sh
yarn build
```
npm package: @onesy/stack
Description: Stack
Author: Lazar
Latest version: 1.0.0


</br>
</br>

<p align='center'>
  <a target='_blank' rel='noopener noreferrer' href='#'>
    <img src='utils/images/logo.svg' alt='onesy logo' />
  </a>
</p>

<h1 align='center'>onesy Stack</h1>

<p align='center'>
  Stack
</p>

<br />

<h3 align='center'>
  <sub>MIT license&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>UMD 1.5kb gzipped&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Browser and Nodejs</sub>
</h3>

<p align='center'>
  <sub>Very simple code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Modern code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Junior friendly&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Typescript&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Made with :yellow_heart:</sub>
</p>

<br />

## Getting started

### Add

```sh
yarn add @onesy/stack
```

### Use cases
- Reversing
- Undo/redo
- Backtracking
- Call stack
- etc.

### Use

```javascript
  import OnesyStack from '@onesy/stack';

  // Make a new stack instance
  const onesyStack = new OnesyStack();

  // Add values
  onesyStack.push(1, 2, 3, 4);

  onesyStack.first;
  // 4

  onesyStack.length;
  // 4

  const value = onesyStack.pop();

  value;
  // 4

  onesyStack.first;
  // 3

  onesyStack.length;
  // 3
```

### Dev

Install

```sh
yarn
```

Test

```sh
yarn test
```

### Prod

Build

```sh
yarn build
```
npm package: @onesy/storage
Description: Storage
Author: Lazar
Latest version: 1.0.0


</br>
</br>

<p align='center'>
  <a target='_blank' rel='noopener noreferrer' href='#'>
    <img src='utils/images/logo.svg' alt='onesy logo' />
  </a>
</p>

<h1 align='center'>onesy Storage</h1>

<p align='center'>
  Storage
</p>

<br />

<h3 align='center'>
  <sub>MIT license&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>UMD 3.2kb gzipped&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub>
  <sub>Browser</sub>
</h3>

<p align='center'>
    <sub>Very simple code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Modern code&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Junior friendly&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Typescript&nbsp;&nbsp;&nbsp;&nbsp;</sub>
    <sub>Made with :yellow_heart:</sub>
</p>

<br />

## Getting started

### Add

```sh
yarn add @onesy/storage
```

### Use

```javascript
  import OnesyStorage from '@onesy/storage';

  const onesyStorage = new OnesyStorage();

  const value = { a: 4 };

  // Add
  onesyStorage.add('a', value);

  // Get
  onesyStorage.get('a');

  // { a: 4 }

  // Remove
  onesyStorage.remove('a');

  onesyStorage.get('a');

  // null
```

### Dev

Install

```sh
yarn
```

Test

```sh
yarn test
```

### Prod

Build

```sh
yarn build
```