open-index/open-npm huggingface dataset:
npm package: @hexadrop/aggregate-root
Description: Hexagonal architecture utils library
Latest version: 2.0.2

<h1 align="center">
  @hexadrop/aggregate-root
</h1>

<p align="center">
  Opinionated aggregate root base class for DDD
</p>

## Installation

```bash
npm install --save @hexadrop/aggregate-root
```

**Using bun**

```bash
bun add @hexadrop/aggregate-root
```

## What it does

-   Default export is an abstract class `AggregateRoot`. This class provides the following:
    -   A `record(...events: DomainEvent[])` method to record events.
    -   A `pullDomainEvents(): DomainEvent[]` method to get uncommitted events.
    -   An abstract `toPrimitives(): Primitives<this>` method to convert the aggregate root to primitives.

## How to use

```typescript
import AggregateRoot from '@hexadrop/aggregate-root';
import DomainEvent from '@hexadrop/event';
import type { Primitives } from '@hexadrop/types/primitives';

class MockEvent extends DomainEvent {
  static override EVENT_NAME = 'event';

  constructor(
    readonly foo: string,
    aggregateId: string
  ) {
    super(MockEvent.EVENT_NAME, aggregateId);
  }
}

class MockAggregateRoot extends AggregateRoot {
  readonly foo: string;

  constructor(primitives: Primitives<MockAggregateRoot>) {
    super();
    this.foo = primitives.foo;
  }

  static create(foo: string): MockAggregateRoot {
    const aggregateRoot = new MockAggregateRoot({ foo });
    aggregateRoot.record(new MockEvent(foo, 'aggregateId'));

    return aggregateRoot;
  }

  override toPrimitives(): Primitives<MockAggregateRoot> {
    return {
      foo: this.foo,
    };
  }
}
```

## Hexadrop Code Quality Standards

Publishing this package we are committing ourselves to the following code quality standards:

-   Respect **Semantic Versioning**: No breaking changes in patch or minor versions
-   No surprises in transitive dependencies: Use the **bare minimum dependencies** needed to meet the purpose
-   **One specific purpose** to meet without having to carry a bunch of unnecessary other utilities
-   **Tests** as documentation and usage examples
-   **Well documented README** showing how to install and use
-   **License favoring Open Source** and collaboration
npm package: @hexadrop/either
Description: Hexagonal architecture utils library
Latest version: 2.0.1

<h1 align="center">
  @hexadrop/either
</h1>

<p align="center">
    Either monad implementation
</p>

```bash
npm install --save @hexadrop/either
```

**Using bun**

```bash
bun add @hexadrop/either
```

## What it does

It provides an implementation of the Either monad in TypeScript. The Either monad is a popular
functional programming concept used to handle computations that can result in two possible outcomes:
a successful result (Right) or an error (Left). This is useful for handling computations that can fail,
providing a way to chain operations while keeping error handling separate.

## How to use

The `@hexadrop/either` package default exports a class `Either` with methods to create an instance
representing a left or right value (`Either.left` and `Either.right`),
check the type of the value (`isLeft` and `isRight`),
retrieve the value (`getLeft`, `getRight`, `getLeftOrElse`, `getRightOrElse`),
and transform the value (`mapLeft`, `mapRight`, `flatMapLeft`, `flatMapRight`).

### Creating an instance

```typescript
import Either from '@hexadrop/either';

// Create a Right value
const right = Either.right('This is a right value');
console.log(right.isRight()); // true
console.log(right.getRight()); // 'This is a right value'

// Create a Left value
const left = Either.left('This is a left value');
console.log(left.isLeft()); // true
console.log(left.getLeft()); // 'This is a left value'
```

### Transforming the value

```typescript
// Use mapRight to transform a Right value
const transformedRight = right.mapRight(value => value.toUpperCase());
console.log(transformedRight.getRight()); // 'THIS IS A RIGHT VALUE'

// Use mapLeft to transform a Left value
const transformedLeft = left.mapLeft(value => value.toUpperCase());
console.log(transformedLeft.getLeft()); // 'THIS IS A LEFT VALUE'
```

### Using flatMap

```typescript
// Use flatMapRight to transform a Right value into a new Either
const flatMappedRight = right.flatMapRight(value => Either.right(value.length));
console.log(flatMappedRight.getRight()); // 20

// Use flatMapLeft to transform a Left value into a new Either
const flatMappedLeft = left.flatMapLeft(value => Either.left(value.length));
console.log(flatMappedLeft.getLeft()); // 19
```

## Hexadrop Code Quality Standards

Publishing this package we are committing ourselves to the following code quality standards:

-   Respect **Semantic Versioning**: No breaking changes in patch or minor versions
-   No surprises in transitive dependencies: Use the **bare minimum dependencies** needed to meet the purpose
-   **One specific purpose** to meet without having to carry a bunch of unnecessary other utilities
-   **Tests** as documentation and usage examples
-   **Well documented README** showing how to install and use
-   **License favoring Open Source** and collaboration
npm package: @hexadrop/error
Description: Hexagonal architecture utils library
Latest version: 2.0.0

<h1 align="center">
  @hexadrop/error
</h1>

<p align="center">
    Opinionated error base class for DDD
</p>

## Installation

```bash
npm install --save @hexadrop/error
```

**Using bun**

```bash
bun add @hexadrop/error
```

## What it does

This package provides an opinionated base class for Domain Errors.
This is meant to be extended and used as a base class for Domain Errors.

It is opinionated in the sense that it enforces a constructor with three arguments:

-   `name`: The name of the error.
-   `message`: The message of the error.
-   `code`: The code of the error. Must follow the next Regexp `/[A-Z][A-Z][A-Z]\((\d{3}|\d{6})\)/`.
    For example `FNL(123)` or `RPA(435678)`

## How to use

```typescript
import DomainError from '@hexadrop/error';

class EmptyErrorCodeError extends DomainError {
  constructor() {
    super('EmptyErrorCodeError', 'DomainError code can not be null or empty', 'HEX(400)');
  }
}
```

## Hexadrop Code Quality Standards

Publishing this package we are committing ourselves to the following code quality standards:

-   Respect **Semantic Versioning**: No breaking changes in patch or minor versions
-   No surprises in transitive dependencies: Use the **bare minimum dependencies** needed to meet the purpose
-   **One specific purpose** to meet without having to carry a bunch of unnecessary other utilities
-   **Tests** as documentation and usage examples
-   **Well documented README** showing how to install and use
-   **License favoring Open Source** and collaboration
npm package: @hexadrop/event
Description: Hexagonal architecture utils library
Latest version: 2.1.0

<h1 align="center">
  @hexadrop/event
</h1>

<p align="center">
  Opinionated package to create and dispatch events for DDD applications.
</p>

```bash
npm install --save @hexadrop/event
```

**Using bun**

```bash
bun add @hexadrop/event
```

## What it does

This package is an opinionated utility designed to streamline the creation and dispatching of events
in CQRS (Command Query Responsibility Segregation) applications. It provides a set of abstractions and utilities
that allow developers to handle events in a structured and efficient way. Key features include:

-   **Event Creation**: Simplifies the process of creating new events.
-   **Event Dispatching**: Provides mechanisms to dispatch events to their respective handlers.
-   **Event Handler Decorators**: Provides decorators to define event handlers.

## How to use

## Hexadrop Code Quality Standards

Publishing this package we are committing ourselves to the following code quality standards:

-   Respect **Semantic Versioning**: No breaking changes in patch or minor versions
-   No surprises in transitive dependencies: Use the **bare minimum dependencies** needed to meet the purpose
-   **One specific purpose** to meet without having to carry a bunch of unnecessary other utilities
-   **Tests** as documentation and usage examples
-   **Well documented README** showing how to install and use
-   **License favoring Open Source** and collaboration
npm package: @hexadrop/ioc
Description: Hexagonal architecture utils library
Latest version: 2.0.0

<h1 align="center">
  @hexadrop/ioc
</h1>

<p align="center">
  An opinionated IoC container interface for TypeScript
</p>

## Installation

```bash
npm install --save @hexadrop/ioc
```

**Using bun**

```bash
bun add @hexadrop/ioc
```

## What it does

This package provides an interface for an IoC container. It does not provide an implementation by itself.

You can use it as a base for your own implementation or use one of the following implementations:

-   [DIOD](https://github.com/artberri/diod): A simple and lightweight IoC container for TypeScript.

## Hexadrop Code Quality Standards

Publishing this package we are committing ourselves to the following code quality standards:

-   Respect **Semantic Versioning**: No breaking changes in patch or minor versions
-   No surprises in transitive dependencies: Use the **bare minimum dependencies** needed to meet the purpose
-   **One specific purpose** to meet without having to carry a bunch of unnecessary other utilities
-   **Tests** as documentation and usage examples
-   **Well documented README** showing how to install and use
-   **License favoring Open Source** and collaboration
npm package: @hexadrop/ploc
Description: Hexagonal architecture utils library
Latest version: 2.0.0

<h1 align="center">
  @hexadrop/ploc
</h1>

<p align="center">
  Opinionated Presentation logic
</p>

```bash
npm install --save @hexadrop/ploc
```

**Using bun**

```bash
bun add @hexadrop/ploc
```

## What it does

## How to use

## Hexadrop Code Quality Standards

Publishing this package we are committing ourselves to the following code quality standards:

-   Respect **Semantic Versioning**: No breaking changes in patch or minor versions
-   No surprises in transitive dependencies: Use the **bare minimum dependencies** needed to meet the purpose
-   **One specific purpose** to meet without having to carry a bunch of unnecessary other utilities
-   **Tests** as documentation and usage examples
-   **Well documented README** showing how to install and use
-   **License favoring Open Source** and collaboration
npm package: @hexadrop/query
Description: Hexagonal architecture utils library
Latest version: 2.1.0

<h1 align="center">
  @hexadrop/query
</h1>

<p align="center">
  Opinionated package to create and dispatch querys for CQRS applications.
</p>

```bash
npm install --save @hexadrop/query
```

**Using bun**

```bash
bun add @hexadrop/query
```

## What it does

## How to use

## Hexadrop Code Quality Standards

Publishing this package we are committing ourselves to the following code quality standards:

-   Respect **Semantic Versioning**: No breaking changes in patch or minor versions
-   No surprises in transitive dependencies: Use the **bare minimum dependencies** needed to meet the purpose
-   **One specific purpose** to meet without having to carry a bunch of unnecessary other utilities
-   **Tests** as documentation and usage examples
-   **Well documented README** showing how to install and use
-   **License favoring Open Source** and collaboration
npm package: @hexadrop/tsconfig
Description: A base TSConfig for working with Node + ESM + Strictest.
Latest version: 0.0.5

<h1 align="center">
  Hexadrop's TypeScript configuration
</h1>

<p align="center">
   TSConfig for working with Node + ESM + Strictest.
</p>

## Installation

```bash
npm install --save-dev @hexadrop/tsconfig
```

**Using bun**

```bash
bun add -d @hexadrop/tsconfig
```

## How to use

Add it to your `tsconfig.json` file:

   ```json
   {
     "extends": "@hexadrop/tsconfig"
   }
   ```

## Hexadrop Code Quality Standards

Publishing this package we are committing ourselves to the following code quality standards:

- Respect **Semantic Versioning**: No breaking changes in patch or minor versions
- No surprises in transitive dependencies: Use the **bare minimum dependencies** needed to meet the purpose
- **One specific purpose** to meet without having to carry a bunch of unnecessary other utilities
- **Tests** as documentation and usage examples
- **Well documented README** showing how to install and use
- **License favoring Open Source** and collaboration
npm package: @hexadrop/types
Description: Hexagonal architecture utils library
Latest version: 2.0.0

<h1 align="center">
  @hexadrop/types
</h1>

<p align="center">
  A useful collection of types for TypeScript projects.
</p>

## Installation

```bash
npm install --save @hexadrop/types
```

**Using bun**

```bash
bun add @hexadrop/types
```

## Hexadrop Code Quality Standards

Publishing this package we are committing ourselves to the following code quality standards:

-   Respect **Semantic Versioning**: No breaking changes in patch or minor versions
-   No surprises in transitive dependencies: Use the **bare minimum dependencies** needed to meet the purpose
-   **One specific purpose** to meet without having to carry a bunch of unnecessary other utilities
-   **Tests** as documentation and usage examples
-   **Well documented README** showing how to install and use
-   **License favoring Open Source** and collaboration
npm package: @hexafuchs/what.js
Description: [![Latest Version on NPM](https://img.shields.io/npm/v/%40hexafuchs%2Fwhat.js?style=flat-square)](https://www.npmjs.com/package/@hexafuchs/what.js) [![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/hexafuchs/what.js/test
Latest version: 2.0.0

# A library to get information about variables

[![Latest Version on NPM](https://img.shields.io/npm/v/%40hexafuchs%2Fwhat.js?style=flat-square)](https://www.npmjs.com/package/@hexafuchs/what.js)
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/hexafuchs/what.js/testing.yml?branch=main&label=tests&style=flat-square)](https://github.com/hexafuchs/what.js/actions?query=workflow%3A"Run+Tests"+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/hexafuchs/what.js/linting.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/hexafuchs/what.js/actions?query=workflow%3A"Run+Linter"+branch%3Amain)
[![Monthly Downloads](https://img.shields.io/npm/dm/%40hexafuchs%2Fwhat.js?style=flat-square)](hhttps://www.npmjs.com/package/@hexafuchs/what.js)

This package is meant to provide helpers to handle data with unknown or ambiguous types in both Javascript and
Typescript, providing both boolean return types and Typescript assertions. It also provides some additional helpers to
handle common use cases, like checking if a variable is "empty", has a certain function, has a special meaning, etc.

## Installation

You can install the package via npm (or another tool of your choosing):

```bash
npm install @hexafuchs/what.js
```

## Usage

Checkout the documentation at [https://hexafuchs.github.io/what.js/](https://hexafuchs.github.io/what.js/).

```typescript
import { isNull } from "@hexafuchs/what.js";

console.log(isNull(null));
```

## Testing

```bash
npm run test
```

## Development

### Building

```bash
npm run build
```

### Dev Server

```bash
npm run dev
```

### Run linter

```bash
npm run lint:scripts
npm run lint:styles
```

## Changelog

Please see [CHANGELOG](https://github.com/Hexafuchs/what.js/blob/main/CHANGELOG.md) for more information on what has changed recently.

## License

The MIT License (MIT). Please see [License File](https://github.com/Hexafuchs/what.js/blob/main/LICENSE.md) for more information.
npm package: @hexagon/base64-arraybuffer
Description: Encode/decode base64 and base64url data into ArrayBuffers
Author: Hexagon
Latest version: 2.0.2
Deprecated: This package is no longer supported, use @hexagon/base64 instead

# @hexagon/base64-arraybuffer

![CI](https://github.com/hexagon/base64-arraybuffer/workflows/CI/badge.svg?branch=master)
[![NPM Downloads](https://img.shields.io/npm/dm/@hexagon/base64-arraybuffer.svg)](https://www.npmjs.org/package/@hexagon/base64-arraybuffer)
[![NPM Version](https://img.shields.io/npm/v/@hexagon/base64-arraybuffer.svg)](https://www.npmjs.org/package/@hexagon/base64-arraybuffer)

Encode/decode base64 or base64url data into ArrayBuffers.

This is basically [github.com/niklasvh/base64-arraybuffer](https://github.com/niklasvh/base64-arraybuffer), but with added base64url support.

### Installing

#### Node 
You can install the module via npm:

```npm install @hexagon/base64-arraybuffer```

```javascript
const base64 = require('@hexagon/base64-arraybuffer');

const result = base64.encode("Hello World!");
const resultUrl = base64.encode("Hello World!", true);
```

#### CDN / Browser / Deno

[www.jsdelivr.com/package/npm/@hexagon/base64-arraybuffer?path=dist](https://www.jsdelivr.com/package/npm/@hexagon/base64-arraybuffer?path=dist)

In a browser, you normally want ```/dist/base64-arraybuffer.umd.js``` which will register a global object named ```base64``` 

```javascript
// Global object base64 available

const result = base64.encode("Hello World!");
const resultUrl = base64.encode("Hello World!", true);
```

## API

The library encodes and decodes base64/base64url to and from ArrayBuffers

 - __encode(buffer)__ - Encodes `ArrayBuffer` into base64 string
 - __decode(str)__ - Decodes base64 string to `ArrayBuffer`

 - __encode(buffer, true)__ - Encodes `ArrayBuffer` into base64url string
 - __decode(str, true)__ - Decodes base64url string to `ArrayBuffer`

### Testing

You can run the test suite with:

    npm test

## License
Copyright (c) 2021 Hexagon
Licensed under the MIT license.

Copyright (c) 2012 Niklas von Hertzen
Licensed under the MIT license.