open-index/open-npm huggingface dataset:
npm package: @lndsld/config-builders
Description: Builder of configs for tools such as webpack
Latest version: 0.2.1

# @lndsld/config-builders

Builder of configs with chaining API for tools such as webpack

## WebpackConfigBuilder

Allows to build [webpack](https://webpack.js.org) config:

```js
/** webpack.config.js */
const { WebpackConfigBuilder } = require("@lndsld/config-builders");

const builder = new WebpackConfigBuilder();

builder
    .merge({
        entry: "src/index.js",
        mode: 'production',
        devtool: 'source-map'
    })
    .addRule({
        test: /.js$/,
        loader: require.resolve("babel-loader")
    });

module.exports = builder.config;
```

## Plugins API

Allows to split configuration to plugins:

```js
/** webpack.config.js */
const { WebpackConfigBuilder } = require("@lndsld/config-builders");
const processJsPlugin = require("./processJsPlugin");

const builder = new WebpackConfigBuilder();

builder
    .merge({
        entry: "src/index.js",
        mode: 'production',
        devtool: 'source-map'
    })
    .apply(processJsPlugin)

module.exports = builder.config;

/** processJsPlugin.js */
function processJsPlugin(builder) {
    builder
        .addRule({
            test: /.js$/,
            loader: require.resolve("babel-loader")
        })
}

module.exports = processJsPlugin;
```

## Env

Allows to pass environment to plugins:

```js
/** webpack.config.js */
const { WebpackConfigBuilder } = require("@lndsld/config-builders");
const path = require("path");
const entrypointPlugin = require("./processJsPlugin");

const builder = new WebpackConfigBuilder({ srcPath: path.resolve(__dirname, "src") });

builder
    .apply(entrypointPlugin)

module.exports = builder.config;

/** entrypointPlugin.js */
const path = require("path");

function entrypointPlugin(builder) {
    builder.merge({
        entry: path.resolve(builder.env.srcPath, "index.js")
    })
}
```

## BabelConfigBuilder

Allows to build config for [babel-loader](https://webpack.js.org/loaders/babel-loader/):

```js
/** webpack.config.js */
const { WebpackConfigBuilder } = require("@lndsld/config-builders");
const processJsPlugin = require("./processJsPlugin");

const builder = new WebpackConfigBuilder({ isTypescript: true });

builder
    .merge({
        entry: "src/index.ts",
        mode: 'production',
        devtool: 'source-map'
    })
    .apply(processJsPlugin)

module.exports = builder.config;

/** processJsPlugin.js */
const { BabelConfigBuilder } = require("@lndsld/config-builders");

function processJsPlugin(builder) {
    const babelBuilder = new BabelConfigBuilder(builder.env);

    babelBuilder.addPreset([
        require.resolve('@babel/preset-env'),
        { targets: { browsers: 'last 2 versions' } }
    ]);

    if(builder.env.isTypescript) {
        babelBuilder.addPreset(require.resolve('@babel/preset-typescript'))
    }

    builder
        .addRule({
            test: /.js$/,
            loader: require.resolve("babel-loader"),
            ...babelBuilder.config
        })
}

module.exports = processJsPlugin;
```
npm package: @lndsld/data-structures
Description: ## 🧬 Structure Typeclasses
Latest version: 0.3.1

# Immutable Data Structures

## 🧬 Structure Typeclasses

- [x] [IDictionary](./src/structures/ImmutableDictionary/IDictionary.d.ts)
- [x] [IList](./src/structures/IList/ImmutableList.d.ts)
- [x] [ISet](./src/structures/ISet/ImmutableSet.d.ts)
- [x] [IStack](./src/structures/IStack/ImmutableStack.d.ts)
- [x] [IKeyTree](./src/structures/IKeyTree/IKeyTree.d.ts)
- [x] [ITree](./src/structures/ITree/ITree.d.ts)
- [x] [IOrderedKeyTree](./src/structures/IOrderedKeyTree/IOrderedKeyTree.d.ts)
- [x] [IRecord](./src/structures/IRecord/IRecord.d.ts)
- [x] [IOrderedTree](./src/structures/IOrderedTree/IOrderedTree.d.ts)

![Hierarchy](./docs/hierarchy.drawio.png)

## 🛠 Utility Functions

- [x] [flow](./src/utils/flow/flow.ts)
- [x] [hash](./src/utils/hash/hash.ts)
- [x] [pipe](./src/utils/pipe/pipe.ts)
- [x] [doNothing](./src/utils/doNothing/doNothing.ts)

## 👻 Type Helpers

- [x] [AnyKey](./src/types/AnyKey.ts)
- [x] [Predicate](./src/types/Predicate.ts)
- [x] [TypeGuard](./src/types/TypeGuard.ts)
- [x] [Transform](./src/types/Transform.ts)
npm package: @lndsld/orc
Description: Minimalistic orchestrator for NPM-scripts and anything else.
Latest version: 0.0.2

# @lndsld/orc

Minimalistic orchestrator for NPM-scripts and anything else.

## Installation

```bash
npm install -g @lndsld/orc
```

## Usage

Imagine React UI library with svg icons and some autogenerated code.

Build pipeline for it will consist of these stages:

1. Generate React components from svg icons
2. Generate barrel file for `components` directory
3. Build whole library with `tsc`

Stages (1) and (2) here are independent, so it could be safely parallelized to reduce total build time.

__Orc__ will do all this work if you specify dependencies between scripts.

### In `package.json`

1. Define scripts in `scripts` section of your `package.json` as usual:

    ```json
    /* package.json */
    {
        "scripts": {
            "generate:barrel": "node scripts/generate-barrel.js",
            "generate:icons": "node scripts/generate-icons.js",
            "build": "tsc"
        }
    }
    ```

2. Define dependencies between scripts in `orc` section of `package.json`:

    ```json
    /* package.json */
    {
        "orc": {
            "scripts": {
                "build": {
                    "dependsOn": ["generate:icons", "generate:barrel"]
                }
            }
        }
    }
    ```

3. Run script with `orc run` command:

    ```bash
    orc run build
    ```

### Without `package.json`

1. Create `orc.config.json` and define scripts:

    ```json
    /* orc.config.json */
    {
        "scripts": {
            "generate:barrel": {
                "command": "node scripts/generate-barrel.js"
            },
            "generate:icons": {
                "command": "node scripts/generate-icons.js"
            },
            "build": {
                "command": "tsc",
                "dependsOn": ["generate:icons", "generate:barrel"]
            }
        }
    }
    ```

2. Run script with `orc run` command:

    ```bash
    orc run build
    ```

## Examples

* [Typescript library with automatic documentation generation](../../examples/ts-lib/package.json)
npm package: @lnear/cache
Description: Lightweight LRU and LFU cache implementations for Node.js and the browser.
Author: lnear
Latest version: 1.0.0

# @lnear/cache

`@lnear/cache` is a TypeScript library that provides implementations for two types of caching mechanisms: Least Recently Used (LRU) and Least Frequently Used (LFU). Caching is crucial in applications to improve performance by storing frequently accessed data in memory.

This package offers flexibility through generic implementations, allowing developers to cache any type of data with customizable options for maximum size and expiration times.

## Installation

Install the package via npm:

```bash
npm install @lnear/cache
```

## Usage

### Importing

Import the cache classes into your TypeScript project:

```typescript
import { LRUCache, LFUCache } from "@lnear/cache";
```

### Creating a Cache Instance

#### LRU Cache Example:

```typescript
// Create an LRU cache with a maximum size of 100 items
const lruCache = new LRUCache<string, number>({ maxSize: 100 });

// Adding entries to the cache
lruCache.set("key1", 1);
lruCache.set("key2", 2);

// Retrieving a value from the cache
const value = lruCache.get("key1").ToChecked(); // Returns 1

// Iterating through cache entries
for (const [key, value] of lruCache.entries()) {
  console.log(`Key: ${key}, Value: ${value}`);
}
```

#### LFU Cache Example:

```typescript
// Create an LFU cache with a maximum size of 100 items
const lfuCache = new LFUCache<string, number>({ maxSize: 100 });

// Adding entries to the cache
lfuCache.set("key1", 1);
lfuCache.set("key2", 2);

// Retrieving a value from the cache
const value = lfuCache.get("key1").ToChecked(); // Returns 1

// Iterating through cache entries
for (const [key, value] of lfuCache.entries()) {
  console.log(`Key: ${key}, Value: ${value}`);
}
```

### API

#### Common Methods for LRUCache and LFUCache

- `set(key: K, value: V, options?: { maxAge?: number }): this`: Adds or updates a key-value pair in the cache.
- `get(key: K): Maybe<V>`: Retrieves the value associated with the key, if present.
- `has(key: K): boolean`: Checks if the cache contains the specified key.
- `delete(key: K): boolean`: Deletes a key-value pair from the cache.
- `clear(): void`: Clears all entries from the cache.
- `resize(newSize: number): void`: Resizes the cache to the new size, evicting entries if necessary.
- `entries(): IterableIterator<[K, V]>`: Returns an iterator for all entries in the cache.
- `forEach(callback: (value: V, key: K, map: Cache<K, V>) => void, thisArg?: any): void`: Executes a callback for each entry in the cache.
- `peek(key: K): Maybe<V>`: Retrieves the value associated with the key without updating its frequency.

### License

This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.

### Support

For questions or issues regarding the package, please [open an issue](https://github.com/lnear-dev/cache/issues) on GitHub.
npm package: @lnear/marco
Description: [[toc]] This is a lightweight (and low level) CSS utilities library aimed at simplifying and standardizing common CSS patterns. It provides a utility function for generating CSS properties and values dynamically.
Latest version: 0.0.7

# Marco - CSS Macro Library

[[toc]]
This is a lightweight (and low level) CSS utilities library aimed at simplifying and standardizing common CSS patterns. It provides a utility function for generating CSS properties and values dynamically.

## Installation

This library is implemented in both TypeScript and PHP. You can install the TypeScript version via npm:

```bash
npm install @lnear/marco
```

and the PHP version via composer:

```bash
composer require lnear/marco
```

## Usage

```javascript
import { replace } from "@lnear/marco";
console.log(
  `div { ${replace(
    "transition-colors",
    "transition-none",
    "blur-md",
    "drop-shadow-xl"
  )} }`
);
```

```php
use Lnear\Marco\Marco;
$m = Marco::macro(
  'transition-colors',
  'transition-none',
  'blur-md',
  'drop-shadow-xl'
);
echo "div { $m }";
```

This will generate the following CSS string:

```css
div {
  transition-property: color, background-color, border-color,
    text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
  transition-property: none;
  filter: blur(12px);
  filter: drop-shadow(0 20px 13px rgb(0 0 0 / 0.03)) drop-shadow(
      0 8px 5px rgb(0 0 0 / 0.08)
    );
}
```

More docs coming soon...

## Patterns

The below are the predefined patterns that can be used with the `replace` function. It is not an exhaustive list and intutive patterns are implemented as needed.
For example, only "saturate-(0, 50, 100, 150, 200)" are documented here, but any value can be used with the "saturate" pattern. (saturate-x where x is a number will be replaced with "filter: saturate({x / 100});")

<details>
  <summary>View Patterns</summary>

{!!patterns!!}

</details>

## Colors

<details>
  <summary>View Colors</summary>

{!!colors!!}

</details>