open-index/open-npm huggingface dataset:
npm package: @iroachie/eslint-config
Description: ESLint preset extending Airbnb, Prettier and Jest
Latest version: 0.0.3

# @iroachie/eslint-config

Eslint config utilizing Airbnb-base, Prettier and Jest support.

Plugins and configs used:

- [eslint-config-airbnb-base](https://yarnpkg.com/en/package/eslint-config-airbnb-base)
- [eslint-config-prettier](https://yarnpkg.com/en/package/eslint-config-prettier)
- [eslint-plugin-jest](https://yarnpkg.com/en/package/eslint-plugin-jest)

Additionally, it sets these environments:

```json
{
  "env": {
    "browser": true,
    "node": true,
    "jest": true,
    "es6": true
  }
}
```

## Installation

```bash
yarn add --dev eslint @iroachie/eslint-config
```

_Note: We're using `yarn` to install deps. Feel free to change commands to use `npm` 3+ and `npx` if you like_

## Usage

Add to your eslint config (`.eslintrc`, or `eslintConfig` field in `package.json`):

```json
{
  "extends": "@iroachie"
}
```

Add the eslint extension for your editor. Example below is VSCode.

- eslint - https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint

In your "User Settings" add the following lines:

```json
"eslint.autoFixOnSave": true,
"editor.formatOnSave": false,
"eslint.validate": [
  {
    "language": "javascript",
    "autoFix": true
  },
  {
    "language": "javascriptreact",
    "autoFix": true
  },
  {
    "language": "typescript",
    "autoFix": true
  },
  {
    "language": "typescriptreact",
    "autoFix": true
  }
],
```

### Example of extending the configuration

```json
{
  "extends": "@iroachie",
  "rules": {
    "global-require": 0,
    "prefer-destructuring": 0
  }
}
```

## Advanced Usage

Optionally in your repo you can set up githooks to format your code when you make a commit.
You can follow the setup over [here](https://github.com/okonet/lint-staged#installation-and-setup).
npm package: @iroak/nodejs-mta-sdk
Description: NodeJS MTA SDK for MTA:SA
Author: iroaK
Latest version: 1.0.1

# NodeJS-MTA-SDK

A Node.js SDK for interacting with MTA:SA servers via HTTP POST requests. This library simplifies communication with MTA:SA server resources and functions.

## Features

- Configure HTTP POST requests to MTA:SA servers.
- Trigger server-side functions with ease.
- Built-in error handling for HTTP requests.

## Installation

Install the package using npm:

```bash
npm install nodejs-mta-sdk
```

## Usage

### Import the SDK

```javascript
const MTA = require('nodejs-mta-sdk');
```

### Create an Instance

```javascript
const mta = new MTA('your-server-host', 22005, 'username', 'password');
```

### Call a Server Function

```javascript
(async () => {
    const response = await mta.call('resourceName', 'functionName', { key: 'value' });
    if (response.status) {
        console.log('Success:', response.data);
    } else {
        console.error('Error:', response.data);
    }
})();
```

## Example

```javascript
const MTA = require('nodejs-mta-sdk');

const mta = new MTA('127.0.0.1', 22005, 'admin', 'password123');

(async () => {
    const result = await mta.call('myResource', 'myFunction', { param1: 'value1' });
    if (result.status) {
        console.log('Server Response:', result.data);
    } else {
        console.error('Request Failed:', result.data);
    }
})();
```

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
npm package: @iroak/nodejs-mysql-helper
Description: Helper of MySQL
Author: iroaK
Latest version: 1.0.2

# NodeJS-MySQL-Helper

## Overview

NodeJS-MySQL-Helper is a simple and efficient library to help you manage MySQL connections and execute queries using Node.js and MySQL2.

## Features

- Connection pooling
- Automatic retry mechanism for failed queries
- Easy-to-use API

## Installation

To install the library, use npm:

```bash
npm install mysql2
```

## Usage

Here's an example of how to use the NodeJS-MySQL-Helper library:

```javascript
const { MySQL } = require('./MySQL');

// Create a new MySQL instance
const db = new MySQL('localhost', 3306, 'user', 'password', 'database');

// Execute a query
async function executeQuery() {
    const result = await db.createQuery('SELECT * FROM users WHERE id = ?', [1]);
    if (result.status) {
        console.log('Query successful:', result.data);
    } else {
        console.error('Query failed:', result.error);
    }
}

executeQuery();
```

## API

### MySQL Class

#### Constructor

```javascript
new MySQL(host, port, user, password, database, tryConnection = 3)
```

- `host` (string): The MySQL server host.
- `port` (number): The MySQL server port.
- `user` (string): The MySQL user.
- `password` (string): The MySQL user's password.
- `database` (string): The MySQL database name.
- `tryConnection` (number, optional): The number of retry attempts for failed queries (default is 3).

#### Methods

##### `getConnection()`

Retrieves a connection from the connection pool.

Returns: `Promise<Connection>`

##### `createQuery(stringQuery, arrayQuery, tryQuery = 0)`

Executes a given SQL query using a connection from the pool.

- `stringQuery` (string): The SQL query string to be executed.
- `arrayQuery` (Array): An array of values to be used in the SQL query.
- `tryQuery` (number, optional): The current attempt number for executing the query (default is 0).

Returns: `Promise<Object>`

## License

See [LICENSE](./LICENSE) in the top-level directory.
npm package: @iroak/nodejs-utils-helper
Description: Nodejs Utils Helper
Author: iroaK
Latest version: 1.2.0

# NodeJS Utils Helper

NodeJS Utils Helper is a library that provides a set of utility functions to simplify common tasks in Node.js development.

## Installation

You can install the library using npm:

```bash
npm install @bastianmarin/nodejs-utils-helper
```

## Usage

Here is an example of how to use the library:

```javascript
const utils = require('@bastianmarin/nodejs-utils-helper');

// Example usage of getAllFiles
const allFiles = utils.getAllFiles('/path/to/directory');
console.log('All Files:', allFiles);

// Example usage of delay
async function exampleDelay() {
    console.log('Waiting for 2 seconds...');
    await utils.delay(2000);
    console.log('2 seconds have passed');
}
exampleDelay();

// Example usage of getRandomNumber
const randomNumber = utils.getRandomNumber(1, 100);
console.log('Random Number:', randomNumber);

// Example usage of shuffleArray
const array = [1, 2, 3, 4, 5];
const shuffledArray = utils.shuffleArray(array);
console.log('Shuffled Array:', shuffledArray);

// Example usage of getFlagEmoji
const flagEmoji = utils.getFlagEmoji('us');
console.log('Flag Emoji:', flagEmoji);

// Example usage of randomString
const randomStr = utils.randomString(10);
console.log('Random String:', randomStr);
```

## Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

## License

This project is licensed under the MIT License.
npm package: @iroam/broker
Description: ## Broker Library
Author: lawrencethindi
Latest version: 1.0.0


# @iroam

## Broker Library

Welcome to the @iroam Broker Library! This library is a part of the larger monorepo dedicated to housing reusable components tailored for microservices architecture. Within this library, you'll find a collection of utilities designed to streamline RabbitMQ messaging in your microservices.

## Table of Contents

- [Introduction](#introduction)
- [Installation](#installation)
- [Usage](#usage)
  - [Publisher](#publisher)
  - [Exchange](#exchange)
  - [Worker Queue](#worker-queue)
- [Configuration](#configuration)
- [Contributing](#contributing)
- [License](#license)

## Introduction

The @iroam Broker Library provides a set of tools to easily manage RabbitMQ messaging within the @iroam microservices architecture. It includes reusable logic for publishers, exchanges, and worker queues.

## Installation

Install the package using npm:

```bash
npm install @iroam/broker
```

## Usage

### Publisher

The Publisher utility allows you to send messages to a specified RabbitMQ exchange with a given routing key. It simplifies the process of message creation and delivery, ensuring consistency and reliability across your microservices.

### Exchange

The Exchange utility helps you declare and manage RabbitMQ exchanges. It supports various exchange types, such as direct, topic, headers, and fanout, enabling flexible message routing based on your application's needs.

### Worker Queue

The Worker Queue utility provides an interface for creating and managing worker queues in RabbitMQ. It handles message consumption, processing, and acknowledgment, making it easier to implement robust and scalable background processing.

## Configuration

Configuration for the @iroam Broker Library is typically managed through environment variables or configuration files. Key settings include the RabbitMQ server URL, exchange names, queue names, and routing keys. Ensure that your microservices are configured to use these settings for seamless integration with the broker library.

## Contributing
npm package: @iroam/config
Description: This contains common configurations for things like env files,loggers etc for easy setup of environment specific settings
Author: lawrencethindi
Latest version: 1.0.0


# @iroam

## Configuration Package

Welcome to the @iroam Configuration Package! This package, part of our monorepo, offers a centralized solution for managing configuration settings across your microservices applications. By consolidating configuration options, you ensure consistency and ease of maintenance throughout your codebase.
npm package: @iroam/errors
Description: This is the global error handler for handling error messages in development and production environments
Author: lawrencethindi
Latest version: 1.0.0


# @iroam

## Error handler package

Welcome to the @iroam Error Handler Package! This package, residing within our monorepo, provides robust error handling capabilities tailored for microservices architecture. It equips you with the tools to effectively manage and respond to errors across your microservices applications, ensuring reliability and resilience.
npm package: @iroam/middlewares
Description: ## Middlewares Package
Author: lawrencethindi
Latest version: 1.0.0


# @iroam

## Middlewares Package

Welcome to the @iroam Middlewares Package! This package, residing within our monorepo, provides a collection of middleware functions tailored for microservices architecture. These middleware functions enable you to enhance and extend the functionality of your microservices applications with ease.
npm package: @iroam/utilities
Description: ## Utilities
Author: lawrencethindi
Latest version: 1.0.0


# @iroam

## Utilities

Welcome to the @iroam Utilities Package! This package is a part of the larger monorepo dedicated to housing reusable utility functions tailored for microservices architecture. Within this package, you'll find a collection of utility functions designed to streamline various aspects of microservices development.