open-index/open-npm huggingface dataset:
npm package: @overbounce/config
Description: Zero dependency configuration module. Because using configuration with bare dotenv does not work with default values nor type checking.
Latest version: 1.0.3

# Config

Zero dependency configuration module. Because using configuration with bare dotenv does not work with default values nor type checking.

## How it works

1. You register configuration key with `.register(key, type, default)` ;
2. The module checks if an environment variable "key" or "KEY" exists and overrides the default value if so ;
3. You use `.get(key)` to get the value.

## Example

```ts
import { Config } from '@overbounce/config'
import dotenv from 'dotenv'

dotenv.config();
Config.register('port', 'integer', 80);
console.log(Config.get('port'));
```

You can also not use the dotenv plugin.
npm package: @overbounce/database
Description: High level library for MySQL using mysql2.
Latest version: 1.0.0

# Database

High level library for MySQL using mysql2.

## Usage

```ts
import {DatabaseSingleton} from '@overbounce/database';

DatabaseSingleton.setParameters({
  host: '127.0.0.1',
  user: 'root',
  password: '',
  database: 'website'
});
DatabaseSingleton.on('error', (message)=>{
  console.log('SQL error:', message);
});

await DatabaseSingleton.connect(); // Can throw
await DatabaseSingleton.executeSQLFile('/home/user/test.sql');
await DatabaseSingleton.query('SELECT username FROM users WHERE id=?', 1337)
await DatabaseSingleton.query('SELECT username FROM users WHERE id=? AND email=?', [1337, 'admin@website']);
await DatabaseSingleton.select('SELECT username FROM users WHERE id=? AND email=?', [1337, 'admin@website']); // [{username: string}] or null
await DatabaseSingleton.selectFirst('SELECT username FROM users WHERE isAdmin=?', 1); // {username: string} or null
await DatabaseSingleton.count('SELECT 1 FROM users WHERE username=? AND password=?', ['admin', 'password']); // returns a number

import {uid} from '@overbounce/uid';
await DatabaseSingleton.generateUnique('user', 'id', uid); // returns a unique string id
await DatabaseSingleton.generateUnique('user', 'id', (): any => {
  return 'random_string';
}); // returns a unique string id

await DatabaseSingleton.dispose();
```
npm package: @overbounce/logger
Description: Opinionated, zero dependency logger module to file and console.
Latest version: 1.0.2

# Logger

Opinionated, zero dependency logger module to file and console.

## How it works

By default the logger will output all logs in a filename in a folder:

- `/var/log/{appName}/logs` if not on Windows ;
- `os.tmpdir()/{appName}/logs` on Windows.

The filename parameters is the filename of the log files. It can contains some
special markup:

- `{DATE}` will be replaced by the current date in the `YYYY-MM-DD` format.
- `{APPNAME}` will be replaced by the app name.

By default, the filename is `{APPNAME}-{DATE}.log`.

## Format

Logger will output things in the following format:

- `[YYYY-MM-DD HH:mm:ss] LEVEL | [category] message`
npm package: @overbounce/rng
Description: Zero dependency random number generator based on sfc32 and MurmurHash3 algo.
Latest version: 1.0.1

# RNG

Zero dependency random number generator based on sfc32 and MurmurHash3 algo.

## Usage

```ts
import {RandomNumberGenerator, DefaultRNG} from '@overbounce/rng';

DefaultRNG.next(); // [0, 1[
DefaultRNG.inclusiveInt(20, 120); // [20, 120]

// You can create a custom instance with a seed
const rng: RandomNumberGenerator = new RandomNumberGenerator('myseed');
rng.next();
```