open-index/open-npm huggingface dataset:
npm package: @rekamy/vue-core
Description: ## Quickstart
Latest version: 0.0.52

# Reka Core Vue

## Quickstart

Install:

```bash
npm install @rekamy/vue-core

# or use yarn

yarn add @rekamy/vue-core

```

Import and register plugin:

```TS
// main.ts or main.js

import { createApp } from "vue";
import App from "./App.vue";

import { RekaCore, RekaPinia } from "@rekamy/vue-core";

// !important to set active pinia instance if accessed from external scope
setActivePinia(RekaPinia);
createApp(App)
    .use(RekaCore)
    .mount("#app");
```

Then, use plugin:

```html
<template>
    <div>
        <div v-permission="['admin']">Only Admin user can see</div>
        <div>All user can see</div>
        <div></div>
    </div>
</template>

<script setup lang="ts">
    import { widget, useRepoStore, crudApi, api } from "vue";

    // using repository store
    const store = useRepoStore("test");
    // update base api endpoint
    api.updateUrl("https://localhost/api/")
    // using crudApi
    console.log(crudApi('test').getUrl())
    // using widget
    widget.alertSuccess("Success")
    setTimeout(widget.close(), 2000)
    widget.toast("Success")
</script>
```

## Todo

- [ ] core
  - [x] api
  - [x] composable
  - [x] directive
  - [x] pinia
  - [x] repository-store
  - [ ] websocket
  - [x] widget
- [ ] generator
npm package: @rekeepit/slate-tools
Description: A modern development toolkit for Shopify themes
Author: Shopify
Latest version: 1.0.0-rki.1

[![npm version](https://badge.fury.io/js/%40shopify%2Fslate-tools.svg)](https://badge.fury.io/js/%40shopify%2Fslate-tools)

# @shopify/slate-tools

Slate Tools provides a sophisticated development experience enabling users to build top-notch Shopify themes.
npm package: @reket/ui
Description: Reket UI Library
Latest version: 0.2.10

# @reket/ui

<strong>REKET UI Library</strong> Based on `React` and `Tailwind CSS`

<br />

## 📦 Install

```sh
// with npm
npm install @reket/ui

// with yarn
yarn add @reket/ui
```

<br />

## ✔️ How to use

```jsx
import { Button } from '@reket/ui';

const YourComponent = () => {
  return <Button text="Button Text" color="purple" size="xl" option="filled" />;
};
```

<br />

## 📒 Storybook

### Link

<a href="https://gcandcompany.github.io/reket-ui/" target="_blank">REKET UI Storybook Page</a>

<br />

### Code Snippets

To create a Storybook file quickly, you can use this snippet:

1. Make a new file called `ComponentName.stories.tsx`.
2. In that file, write "storybook".
3. Then, the code below will be added to the file automatically:

```tsx
import type { Meta, StoryObj } from '@storybook/react';

import { ComponentName } from './ComponentName';
import { generateDocsIntro } from '../../../utils/storybook/docsHelper';
// Update the import path based on this component's location

const meta: Meta<typeof ComponentName> = {
  component: ComponentName,
  title: 'Component/ComponentName',
  parameters: {
    docs: {
      description: {
        component: generateDocsIntro('ComponentName'),
      },
    },
  },
  argTypes: {},
};
export default meta;

type Story = StoryObj<typeof ComponentName>;

export const Default: Story = {
  args: {},
};
```
npm package: @rekeye/advent-of-code
Description: A repo containing solutions for the Advent Of Code.
Author: rekeye
Latest version: 1.1.4

# Advent of code

A repo containing solutions for the Advent Of Code.

The solutions are written in Typescript with Node.js

## Requirements

### `npm`

This project uses npm for installing dependencies and packing the solutions.
To install npm on your system please visit [the official NPM documentation.](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)

## Installing 

Install the package with `npm install @rekeye/advent-of-code`

## Usage


Run the selected script using `day{One | Two | Three | etc.}`

## Installing locally

Install the dependencies with `npm install`.

If you want you can swap the inputs in the `_inputs` folder.

## Possible scripts 

### Run a selected day

Run the selected script using `npm run day{One | Two | Three | etc.}`

### Tests

To run tests use `npm run test`
npm package: @rekkeh/better-auth
Description: The most comprehensive authentication library for TypeScript.
Latest version: 4.0.5

<p align="center">
  <picture>
    <source srcset="https://github.com/better-auth/better-auth/blob/main/banner-dark.png?raw=true" media="(prefers-color-scheme: dark)">
    <source srcset="https://github.com/better-auth/better-auth/blob/main/banner.png?raw=true" media="(prefers-color-scheme: light)">
    <img src="https://github.com/better-auth/better-auth/blob/main/banner.png?raw=true" alt="Better Auth Logo">
  </picture>
  <h2 align="center">
    Better Auth
  </h2>

  <p align="center">
    The most comprehensive authentication library for TypeScript
    <br />
    <a href="https://better-auth.com"><strong>Learn more »</strong></a>
    <br />
    <br />
    <a href="https://discord.gg/better-auth">Discord</a>
    ·
    <a href="https://better-auth.com">Website</a>
    ·
    <a href="https://github.com/better-auth/better-auth/issues">Issues</a>
  </p>
</p>




## Getting Started

```bash
pnpm install better-auth
```

Read the [Installation Guide](https://better-auth.com/docs/installation) to learn more.
npm package: @rekkeh/cli
Description: The CLI for Better Auth
Latest version: 4.0.3

# Better Auth CLI

Better Auth comes with a built-in CLI to help you manage the database schema needed for both core functionality and plugins.


### **Init**

The CLI includes an `init` command to add Better Auth to your project.

```bash title="terminal"
npx @better-auth/cli@latest init
```

### **Generate**

The `generate` command creates the schema required by Better Auth. If you're using a database adapter like Prisma or Drizzle, this command will generate the right schema for your ORM. If you're using the built-in Kysely adapter, it will generate an SQL file you can run directly on your database.

```bash title="terminal"
npx @better-auth/cli@latest generate
```

### **Migrate**

The `migrate` command applies the Better Auth schema directly to your database. This is available if you’re using the built-in Kysely adapter. For other adapters, you'll need to apply the schema using your ORM's migration tool.

```bash title="terminal"
npx @better-auth/cli@latest migrate
```

### **Secret**

The CLI also provides a way to generate a secret key for your Better Auth instance.

```bash title="terminal"
npx @better-auth/cli@latest secret
```


## License

MIT
npm package: @rekkeh/expo
Description: This plugin integrates Better Auth with Expo, allowing you to easily add authentication to your Expo (React Native) applications. It supports both Expo native and web apps.
Latest version: 4.0.3

# Better Auth Expo Plugin

This plugin integrates Better Auth with Expo, allowing you to easily add authentication to your Expo (React Native) applications. It supports both Expo native and web apps.

## Installation

To get started, install the necessary packages:

```bash
# Using npm
npm install better-auth @better-auth/expo

# Using yarn
yarn add better-auth @better-auth/expo

# Using pnpm
pnpm add better-auth @better-auth/expo

# Using bun
bun add better-auth @better-auth/expo
```

You will also need to install `expo-secure-store` for secure session and cookie storage in your Expo app:

```bash
npm install expo-secure-store
# or
yarn add expo-secure-store
# or
pnpm add expo-secure-store
# or
bun add expo-secure-store
```

## Basic Usage

### Configure the Better Auth Backend

Ensure you have a Better Auth backend set up. You can follow the main [Installation Guide](https://www.better-auth.com/docs/installation).

Then, add the Expo plugin to your Better Auth server configuration (e.g., in your `auth.ts` or `lib/auth.ts` file):

```typescript
// lib/auth.ts
import { betterAuth } from "better-auth";
import { expo } from "@better-auth/expo"; // Import the server plugin

export const auth = betterAuth({
    // ...your other Better Auth options
    baseURL: "http://localhost:8081", // The base URL of your application server where the routes are mounted.
    plugins: [expo()], // Add the Expo server plugin
    emailAndPassword: { 
        enabled: true,
    },
    // Add other configurations like trustedOrigins
    trustedOrigins: ["myapp://"] // Replace "myapp" with your app's scheme
});
```

### Initialize the Better Auth Client in Expo

In your Expo app, initialize the client (e.g., in `lib/auth-client.ts`):

```typescript
// lib/auth-client.ts
import { createAuthClient } from "better-auth/react";
import { expoClient } from "@better-auth/expo/client"; // Import the client plugin
import * as SecureStore from "expo-secure-store";

export const authClient = createAuthClient({
    baseURL: "http://localhost:8081", // Your Better Auth backend URL
    plugins: [
        expoClient({
            scheme: "myapp", // Your app's scheme (defined in app.json)
            storagePrefix: "myapp", // A prefix for storage keys
            storage: SecureStore, // Pass SecureStore for token storage
        })
    ]
});

// You can also export specific methods if you prefer:
// export const { signIn, signUp, useSession } = authClient;
```
Make sure your app's scheme (e.g., "myapp") is defined in your `app.json`.

## Documentation

For more detailed information and advanced configurations, please refer to the documentation:

- **Main Better Auth Installation:** [https://www.better-auth.com/docs/installation](https://www.better-auth.com/docs/installation)
- **Expo Integration Guide:** [https://www.better-auth.com/docs/integrations/expo](https://www.better-auth.com/docs/integrations/expo)

## License

MIT
npm package: @rekog/passport-stack-exchange
Description: Stack Exchange authentication strategy for Passport and Node.js.
Author: Rekog-Engineering
Latest version: 1.0.1

# Passport-Stack-Exchange

[Passport](https://github.com/jaredhanson/passport) strategy for authenticating with [Stack Exchange](https://stackexchange.com/) using the OAuth 2.0 API.

This module lets you authenticate using Stack Exchange in your Node.js applications. By plugging into Passport, Stackexchange authentication can be easily and unobtrusively integrated into any application or framework that supports [Connect](http://www.senchalabs.org/connect/)-style middleware, including [Express](http://expressjs.com/).

## Install

```bash
npm install passport-stack-exchange
```

## Usage

#### Configure Strategy

The Stack Exchange authentication strategy authenticates users using a Stack Exchange account (Stack Overflow) and OAuth tokens.  The strategy requires a `verify` callback, which accepts these credentials and calls `done` providing a user, as well as `options` specifying a consumer key, consumer secret, callback URL, and API key for [Stackapps](https://stackapps.com). Register the application on the [service page](https://stackapps.com/apps/oauth/register).

```javascript
var StackExchangeStrategy = require('passport-stack-exchange');

passport.use(new StackExchangeStrategy({
    clientID: STACKEXCHANGE_CLIENT_ID,
    clientSecret: STACKEXCHANGE_CLIENT_SECRET,
    callbackURL: 'http://127.0.0.1:3000/auth/stack-exchange/callback',
    stackAppsKey: STACKEXCHANGE_APPS_KEY,
    site: 'stackoverflow'
  },
  function(accessToken, refreshToken, profile, done) {
    User.findOrCreate({ stackexchangeId: profile.username }, function (err, user) {
      return done(err, user);
    });
  }
));
```

#### Authenticate Requests

Use `passport.authenticate()`, specifying the `'stack-exchange'` strategy, to authenticate requests.

For example, as route middleware in an [Express](http://expressjs.com/) application:

```javascript
app.get('/auth/stack-exchange',
  passport.authenticate('stack-exchange'));

app.get('/auth/stack-exchange/callback',
  passport.authenticate('stack-exchange', { failureRedirect: '/login' }),
  function(req, res) {
    // Successful authentication, redirect home.
    res.redirect('/');
  });
```

## Examples

For a complete, working example, refer to the [login example](https://github.com/acruxray/passport-stack-exchange/tree/master/examples).

## Credits

* [Moo Yeol, Lee (Prescott)](http://github.com/mooyoul)
* [Jared Hanson](http://github.com/jaredhanson)

## License

[The MIT License](http://opensource.org/licenses/MIT)

Copyright (c) 2015 Moo Yeol, Lee (Prescott)
npm package: @rekt-finance-v2/uikit
Description: Set of UI components for rekt projects
Author: ton
Latest version: 0.55.0

# 🥞 Pancake UIkit

[![Version](https://img.shields.io/npm/v/@pancakeswap-libs/uikit)](https://www.npmjs.com/package/@pancakeswap-libs/uikit) [![Size](https://img.shields.io/bundlephobia/min/@pancakeswap-libs/uikit)](https://www.npmjs.com/package/@pancakeswap-libs/uikit)

Pancake UIkit is a set of React components and hooks used to build pages on Pancake's apps. It also contains a theme file for dark and light mode.

## Install

`yarn add @pancakeswap-libs/uikit`

## Setup

### Theme

Before using Pancake UIkit, you need to provide the theme file to styled-component.

```
import { ThemeProvider } from 'styled-components'
import { light, dark } from '@pancakeswap-libs/uikit'
...
<ThemeProvider theme={isDark}>...</ThemeProvider>
```

### Reset

A reset CSS is available as a global styled component.

```
import { ResetCSS } from '@pancakeswap-libs/uikit'
...
<ResetCSS />
```

### Types

This project is built with Typescript and export all the relevant types.

## How to use the UIkit

If you want to use components from the UIkit, check the [Storybook documentation](https://pancakeswap.github.io/pancake-uikit/)
npm package: @rekt-finance/uikit
Description: Set of UI components for rekt-finance projects
Author: ton
Latest version: 0.1.1

# Panther UIkit

Panther UIkit is a set of React components and hooks used to build pages on Panther's apps. It also contains a theme file for dark and light mode.

## Install

`yarn add @pantherswap-libs/uikit`

## Setup

### Theme

Before using Panther UIkit, you need to provide the theme file to styled-component.

```
import { ThemeProvider } from 'styled-components'
import { light, dark } from '@pantherswap-libs/uikit'
...
<ThemeProvider theme={isDark}>...</ThemeProvider>
```

### Reset

A reset CSS is available as a global styled component.

```
import { ResetCSS } from '@pantherswap-libs/uikit'
...
<ResetCSS />
```

### Types

This project is built with Typescript and export all the relevant types.
npm package: @rektangel/eslint-config
Description: eslint and prettier config for all Rektangel projects
Author: @ErikSamuelsson
Latest version: 1.5.1

# ESLint Config

This is for projects with TypeScript, Prettier and React.

## Installation

To be able to use this config we need to install `prettier` and `eslint` together with plugins and rules sets. We can do that with one command.

```shell
npx install-peerdeps @rektangel/eslint-config --dev --yarn
```

This will install all required dependencies as devDependencies in your project. At the moment everything is included here and if you know what you are doing you can install just the ones you need manually. For example if you are not using React you can skip the `eslint-plugin-react`.

The above command will install all peer-deps together with the actual package (this package, you are reading about). If you want to install it yourself you can do that with:

```shell
yarn add --dev @rektangel/eslint-config
```

When the config is installed we need to enable it. Add this property to your `package.json`:

```json
{
  "eslintConfig": {
    "extends": "@rektangel/eslint-config"
  }
}
```

You also need to set some prettier rules. Create a `.prettierrc` file in the root directory and add this:

````json
{
  "singleQuote": true
}
````

## Usage

Enable `eslint` linting in your IDE and/or run `yarn run eslint ./ --ext .ts,.tsx,.js` in the terminal.
npm package: @rektangel/polygon-ui
Description: UI library for Rektangel
Author: @ErikSamuelsson
Latest version: 0.7.0

# polygon-ui

React component library for Rektangel

## Installation

First we need to make sure we have all peer dependencies (like React) installed:

```shell
npx install-peerdeps --dev @rektangel/polygon-ui
```

Then we install the actual package with:

```shell
yarn add --dev @rektangel/polygon-ui
```

## Usage

To be able to use all the components in your React application there are only to two things you need to ensure first.

* Add `data-theme="light"` to a higher ordered, wrapping element (preferably the body tag)

After that you can use the components just as you are used to.

```javascript
import React from 'react';
import { Button, H1 } from '@rektangel/polygon-ui';

const MyApp = () => (
  <div data-theme="light">
    <H1>Hello</H1>
    <Button>Clicky clicky</Button>
  </div>
);

export default MyApp;
```

### Theming

By changing the wrapping `data-theme` to another theme will use different css variables. You can currently use `light` or `dark` theme. You can toggle this dynamically and the components will render correctly in the browser.

There is also a global style included in the package which is supposed to be used in conjunction with the components. Add `import '@rektangel/polygon-ui/dist/styles/global.css'` in a wrapping component.

If you want to use the colors or variables in your own design/components they are included as scss variables in `@rektangel/polygon-ui/dist/styles/colors.scss` / `[...]/variables.scss`. **Note that these are scss files that probably need to be compiled if used in your project.**

## Development

When building, all styles are copied (and some compiled) from `src/styles` to `dist/styles`. This is done in `rollup.config.js` so if you are changing or adding styles this file needs to be updated to include the new ones.
npm package: @rektdogs/contracts
Description: This is a basic hardhat template to get you started writing and compiling contract. The template is configured with some sensible defaults but tries to stay minimal. It comes with most sensible plugins already installed via the suggested `hardhat-toolbox`
Author: amanusk
Latest version: 0.0.1

# Solidity Template

This is a basic hardhat template to get you started writing and compiling contract.
The template is configured with some sensible defaults but tries to stay minimal.
It comes with most sensible plugins already installed via the suggested `hardhat-toolbox`.

- [Hardhat](https://github.com/nomiclabs/hardhat): compile and run the smart contracts on a local development network
- [TypeChain](https://github.com/ethereum-ts/TypeChain): generate TypeScript types for smart contracts
- [Ethers](https://github.com/ethers-io/ethers.js/): renowned Ethereum library and wallet implementation

Use the template by clicking the "Use this template" button at the top of the page.

## Usage

### Pre Requisites

Before running any command, make sure to install dependencies:

```sh
yarn install
```

### Compile

Compile the smart contracts with Hardhat:

```sh
yarn compile
```

### Test

Run the tests:

```sh
yarn test
```

#### Test gas costs

To get a report of gas costs, set env `REPORT_GAS` to true

To take a snapshot of the contract's gas costs

```sh
yarn test:gas
```

### Deploy contract to network (requires Mnemonic and Infura API key)

```
npx hardhat run --network goerli ./scripts/deploy.ts
```

### Validate a contract with etherscan (requires API key)

```
npx hardhat verify --network <network> <DEPLOYED_CONTRACT_ADDRESS> "Constructor argument 1"
```

## Thanks

If you like it than you shoulda put a start ⭐ on it

Twitter: [@amanusk\_](https://twitter.com/amanusk_)

## License

MIT
npm package: @rektfinance/rekt-swap-sdk
Description: 🛠 An SDK for building applications on top of Rektswap.
Author: ton
Latest version: 2.4.0

# Pancakeswap SDK

Forked from the [Uniswap SDK](https://github.com/Uniswap/uniswap-v2-sdk/commit/a88048e9c4198a5bdaea00883ca00c8c8e582605).

You can refer to the Uniswap SDK documentation [uniswap.org](https://uniswap.org/docs/v2/SDK/getting-started/).

## Running tests

To run the tests, follow these steps. You must have at least node v10 and [yarn](https://yarnpkg.com/) installed.

First clone the repository:

```sh
git clone https://github.com/pancakeswap/pancake-swap-sdk.git
```

Move into the pancakeswap-sdk working directory

```sh
cd pancakeswap-sdk/
```

Install dependencies

```sh
yarn install
```

Run tests

```sh
yarn test
```

You should see output like the following:

```sh
yarn run v1.22.4
$ tsdx test
 PASS  test/constants.test.ts
 PASS  test/pair.test.ts
 PASS  test/fraction.test.ts
 PASS  test/miscellaneous.test.ts
 PASS  test/entities.test.ts
 PASS  test/trade.test.ts

Test Suites: 1 skipped, 6 passed, 6 of 7 total
Tests:       3 skipped, 82 passed, 85 total
Snapshots:   0 total
Time:        5.091s
Ran all test suites.
✨  Done in 6.61s.
```
npm package: @rektfinance/rekt-uikit
Description: Set of UI components for rekt projects
Author: ton
Latest version: 0.54.5

# Rekt UIkit


Rekt UIkit is a set of React components and hooks used to build pages on Rekt's apps. It also contains a theme file for dark and light mode.

## Install

`yarn add @rektfinance/rekt-uikit`

## Setup

### Theme

Before using Rekt UIkit, you need to provide the theme file to styled-component.

```
import { ThemeProvider } from 'styled-components'
import { light, dark } from '@rektfinance/rekt-uikit'
...
<ThemeProvider theme={isDark}>...</ThemeProvider>
```

### Reset

A reset CSS is available as a global styled component.

```
import { ResetCSS } from '@rektfinance/rekt-uikit'
...
<ResetCSS />
```

### Types

This project is built with Typescript and export all the relevant types.
npm package: @rekuway/idn-cli
Description: 🛡️ Rekuway IDN CLI - Enterprise-grade Adaptive Identity Defense Installer
Author: Rekuway Team
Latest version: 1.0.3

# 🛡️ Rekuway IDN CLI

Enterprise-grade CLI installer for Rekuway IDN

## Quick Start

```bash
npx @rekuway/idn-cli init
```

## Features

- ✅ Auto-detects framework
- ✅ Tests connections
- ✅ Generates integration code

## Documentation

https://rekuway.gitbook.io/rekuway-docs
npm package: @relab/app-info
Description: Utility package to display app info in browser console
Author: Sergey Zwezdin
Latest version: 1.1.12

# @relab/app-info

Utility to display app info in browser console.

**Features**
- 
- 🚀 Zero dependencies
- 🌓 Dark/light mode support
- 💡 Multiple theme support
- 💥 Works in SSR environment

![app-info](./docs/demo.png)

## Usage

1. `npm install --save @relab/app-info`
2. Add `displayAppInfo()` at the start of your app
```typescript
displayAppInfo('My Cool Application', {
    Version: '1.0.0',
    Commit: 'e8c97b69084b65a2b728528ad7a2aab5de7869bc',
    Branch: 'refs/heads/master',
    'Build Number': '7'
})
```

## Options

- `theme` - one of predefined theme, supported options are: `Blue`, `Cyan`, `Emerald`, `Gray`, `Green`, `Indigo`, `Lime`, `Orange`, `Pink`, `Purple`, `Zinc` (default: `Zinc`)
- `printStartTime` - whether to print application start time (default: `true`)

```typescript
displayAppInfo('My Cool Application', {
    Version: '1.0.0',
    Commit: 'e8c97b69084b65a2b728528ad7a2aab5de7869bc',
    Branch: 'refs/heads/master',
    'Build Number': '7'
}, {
    printStartTime: false,
    theme: 'Indigo'
})
```

## Themes

![Themes](./docs/themes.png)

## License

Released under [MIT](/LICENSE) by [Sergey Zwezdin](https://github.com/sergeyzwezdin).
npm package: @relab/eslint-config
Description: Shareable configuration for eslint
Author: Sergey Zwezdin
Latest version: 2.2.12

# @relab/eslint-config

Shareable configuration for eslint

## Usage

1. Install packages `eslint` and `@relab/eslint-config`
```bash
npm install eslint --save-dev
npm install @relab/eslint-config --save-dev
```
2. Update `package.json` 

**Node project:**
```json
{
  "scripts": {
    "lint": "eslint . --ext ts,tsx"
  },
  "eslintConfig": {
    "extends": "@relab/eslint-config/node"
  }
}
```

**Next project:**
```json
{
  "scripts": {
    "lint": "eslint . --ext ts,tsx"
  },
  "eslintConfig": {
    "extends": "@relab/eslint-config/next"
  }
}
```

## Available configurations

- Node: `@relab/eslint-config/node`
- Next: `@relab/eslint-config/next`

## License

Released under [MIT](/LICENSE) by [Sergey Zwezdin](https://github.com/sergeyzwezdin).
npm package: @relab/fastify-correlation-id
Description: Fastify plugin to store and retrieve correlation IDs.
Author: Sergey Zwezdin
Latest version: 1.0.11

# @relab/fastify-correlation-id

Fastify plugin to store and retrieve correlation IDs.

The plugin retrieves the `X-Correlation-ID` header (_or any other desired header_) from the request and makes it accessible throughout the application code. It also propagates the header to the response.

## Requirements

- Node 18+
- Fastify 4+

## Installation

### NPM

```
npm install --save @relab/fastify-correlation-id
```

### PNPM

```
pnpm add @relab/fastify-correlation-id
```

## Usage

```typescript
import Fastify from 'fastify'
import { CorrelationId } from '@relab/fastify-correlation-id'

const fastify = Fastify()
    .register(CorrelationId, {
        header: 'X-Correlation-ID', // optional
        skipResponseHeader: true, // optional
    })
```


## Configuration

There are some environment variables used to configure logger.

| Option                | Description                                                                | Default            |
|-----------------------|----------------------------------------------------------------------------|--------------------|
| `header`              | Header name for correlation ID.                                            | `X-Correlation-ID` |
| `skipResponseHeader`  | If set to `true`, it will not propagate correlation ID to response header. | `false`            |   

## License

Released under [MIT](/LICENSE) by [Sergey Zwezdin](https://github.com/sergeyzwezdin).
npm package: @relab/fastify-health-check
Description: Fastify plugin that provides health probes and exposes corresponding endpoints.
Author: Sergey Zwezdin
Latest version: 1.0.11

# @relab/fastify-health-check

Fastify plugin that provides health probes and exposes corresponding endpoints.

## Requirements

- Node 18+
- Fastify 4+

## Installation

### NPM

```
npm install --save @relab/fastify-health-check
```

### PNPM

```
npm add @relab/fastify-health-check
```

## Usage

```typescript
import { HealthCheck, ComponentsHealthCheck, HealthChecks } from '@relab/fastify-health-check'
import { handleShutdown, onShutdown } from '@relab/graceful-shutdown'

// Just generic health check
// Returns HTTP 200 unless you throw HealthCheckError
const startup: HealthCheck = {
    url: 'startup',
    check: () => {
        // check your resources if needed
    },
}

// Health check that allows to track multiple component
// Use probe.setHealthy('<component name>') to make it healthy
// Health check returns HTTP once all components are healthy
export const ready = new ComponentsHealthCheck('ready', ['http'])

const live: HealthCheck = {
    url: 'live',
    check: () => {
        // check your resources if needed
        if (/* something wrong */) {
            throw new HealthCheckError({ database: 'Unhealthy' })
        }
        return { uptime: process.uptime() }
    },
}

const fastify = Fastify({
        logger: true,
    })
    // Now your probes available at /health/startup, /health/ready and /health/live
    .register(HealthChecks, {
        prefix: 'health',
        probes: [startup, ready, live],
    })

fastify.addHook('onListen', done => {
    ready.setHealthy('http')
    done()
})

onShutdown(async () => {
    ready.setUnhealthy('http')
})

fastify.listen({ port: 3000 })

handleShutdown()
```
## License

Released under [MIT](/LICENSE) by [Sergey Zwezdin](https://github.com/sergeyzwezdin).
npm package: @relab/graceful-shutdown
Description: Graceful shutdown for Node.js application
Author: Sergey Zwezdin
Latest version: 1.0.13

# @relab/graceful-shutdown

Tiny and stupid simple dependency-free Node.js library to shut down gracefully.

## Requirements

- Node 18+

## Installation

### NPM

```
npm install --save @relab/graceful-shutdown
```

### PNPM

```
npm add @relab/graceful-shutdown
```

## Usage

```Typescript
import { handleShutdown, onShutdown } from '@relab/graceful-shutdown'

// ...

onShutdown(async () => {
    // clean up your resources here
})

// setup graceful shutdown
handleShutdown()
```

### Custom shutdown timeout

```Typescript
import { handleShutdown, onShutdown } from '@relab/graceful-shutdown'

// ...

// setup graceful shutdown
handleShutdown({
    // 3000ms timeout to complete all shutdown tasks (default - 5000)
    timeout: 3000
})
```

### Shutdown callbacks

```Typescript
import { handleShutdown, onShutdown } from '@relab/graceful-shutdown'

// ...

handleShutdown({
    onShutdownStart: () => {
        console.log('Shut down requested')
    },
    onShutdownError: reason => {
        console.log(`Shutdown tasks error: ${reason}`)
    },
    onShutdownComplete: () => {
        console.log('Shutdown tasks completed')
    },
})
```

## License

Released under [MIT](/LICENSE) by [Sergey Zwezdin](https://github.com/sergeyzwezdin).
npm package: @relab/nestjs-common
Description: Common helpers for Nest.js
Author: Sergey Zwezdin
Latest version: 1.1.1

# @relab/nestjs-common

Common decorators for NestJS (Fastify) applications to simplify access to cookies, client IP, and user-agent information in your controllers.

## Features

- **@Cookie**: Access cookies from incoming requests easily.
- **@Ip**: Retrieve the client IP address, supporting proxies via `x-forwarded-for`.
- **@UserAgent**: Get the user-agent string from the request headers.

## Installation

```bash
pnpm add @relab/nestjs-common
# or
yarn add @relab/nestjs-common
# or
npm install @relab/nestjs-common
```

> **Note:** This package is designed for use with [NestJS](https://nestjs.com/) and [Fastify](https://www.fastify.io/). Make sure you have `@nestjs/common`, `@nestjs/core`, `fastify`, and `@fastify/cookie` installed as peer dependencies.

## Usage

Import the decorators in your controller and use them as parameter decorators:

```typescript
import { Controller, Get } from '@nestjs/common';
import { Cookie, Ip, UserAgent } from '@relab/nestjs-common';

@Controller('example')
export class ExampleController {
  @Get('info')
  getInfo(
    @Cookie('sessionId') sessionId: string,
    @Ip() ip: string,
    @UserAgent() userAgent: string,
  ) {
    return {
      sessionId,
      ip,
      userAgent,
    };
  }
}
```

### API Reference

#### `@Cookie(name?: string)`
- Retrieves the value of the specified cookie from the request. If no name is provided, returns the entire cookies object.

#### `@Ip()`
- Returns the client's IP address. If the `x-forwarded-for` header is present, it uses the first value from that header.

#### `@UserAgent()`
- Returns the user-agent string from the request headers.

## License

MIT
npm package: @relab/nestjs-grpc
Description: GRPC helpers for Nest.js
Author: Sergey Zwezdin
Latest version: 1.1.0

# @relab/nestjs-grpc

## Purpose

Helpers for integrating gRPC with [NestJS](https://nestjs.com/) microservices. Provides a one-call setup to attach a gRPC microservice and a global exception filter that maps NestJS errors to proper gRPC status codes.

### Key Features

- **One-call setup**: Attach a gRPC microservice transport to your NestJS app.
- **Global gRPC exception filter**: Converts `HttpException`, `RpcException`, and generic `Error` to gRPC-compatible errors with appropriate status codes.
- **Config inheritance**: Microservice inherits your main app configuration.

---

## Installation

```bash
pnpm add @relab/nestjs-grpc
```

---

## Usage

### Attach gRPC microservice

**main.ts**
```typescript
import { NestFactory } from '@nestjs/core'
import { AppModule } from './app.module'
import { configureGrpcMicroservice } from '@relab/nestjs-grpc'

async function bootstrap() {
    const app = await NestFactory.create(AppModule)

    await configureGrpcMicroservice(app, {
        package: ['your.protobuf.package'],
        protoPath: ['path/to/your.proto'],
        url: '0.0.0.0:50051',
    })

    await app.startAllMicroservices()
    await app.listen(3000)
}

bootstrap()
```

---

## API

### `configureGrpcMicroservice(app, options)`

Attaches a gRPC microservice to your NestJS app and registers a global `GrpcExceptionFilter`.

#### Parameters

- **app**: `INestApplication` — Your NestJS application instance.
- **options**: `GrpcOptions['options']` — Standard NestJS gRPC transport options, e.g. `package`, `protoPath`, `url`, etc.

---

## Behavior

- Registers `GrpcExceptionFilter` globally for RPC contexts.
- Maps errors to gRPC status codes:
  - `HttpException` → mapped to `INVALID_ARGUMENT`, `UNAUTHENTICATED`, `PERMISSION_DENIED`, `NOT_FOUND`, `ALREADY_EXISTS`, `INTERNAL`, `UNAVAILABLE` (based on HTTP status).
  - `RpcException` → passes through original error payload.
  - `Error`/unknown → `INTERNAL` with name and details.
- Connects the microservice with `inheritAppConfig: true` so global pipes/filters/interceptors are reused.

---

## Import

```ts
export { configureGrpcMicroservice } from '@relab/nestjs-grpc'
```

---

## License

MIT
npm package: @relab/nestjs-trace-context
Description: Implementation trace context for Nest.js
Author: Sergey Zwezdin
Latest version: 3.7.0

# @relab/nestjs-trace-context

## Purpose

`@relab/nestjs-trace-context` provides seamless propagation and management of the [W3C Trace Context](https://www.w3.org/TR/trace-context/) (`traceparent` header) in NestJS applications, supporting both HTTP (Fastify) and microservices (RabbitMQ via amqplib).  
It enables distributed tracing by ensuring that trace context is available throughout your request lifecycle, making it easy to correlate logs and traces across services.

---

## Features

- **Automatic extraction and propagation** of the `traceparent` header for HTTP and microservice requests.
- **Async context management** using Node.js `AsyncLocalStorage` for safe trace context access throughout the request.
- **NestJS Middleware** for HTTP servers (Fastify).
- **NestJS Interceptor** for microservices (RabbitMQ).
- **Simple API** to access the current trace context anywhere in your application.

---

## Installation

```bash
pnpm add @relab/nestjs-trace-context
# or
npm install @relab/nestjs-trace-context
```

**Peer dependencies:**  
Make sure you have the following installed in your project:
- `@nestjs/common`
- `@nestjs/core`
- `@nestjs/microservices`
- `amqplib`
- `fastify`
- `rxjs`

---

## Usage

### 1. HTTP (Fastify) Setup

**main.ts**
```typescript
import { configureTraceContext } from '@relab/nestjs-trace-context'

const app = /* create nestjs app */

configureTraceContext(app)
```

**app.module.ts**
```typescript
import { Module, NestModule, MiddlewareConsumer } from '@nestjs/common'
import { TraceContextModule, TraceContextMiddleware } from '@relab/nestjs-trace-context'

@Module({
  imports: [TraceContextModule],
})
export class AppModule implements NestModule {
  configure(consumer: MiddlewareConsumer) {
    consumer.apply(TraceContextMiddleware).forRoutes('*')
  }
}
```

### 2. Microservices (RabbitMQ) Setup

The `configureTraceContext(app)` call (see above) automatically registers the `TraceContextMicroserviceInterceptor` globally for your app, enabling trace context propagation for microservice handlers.

---

## Accessing Trace Context

Anywhere in your application, inject `TraceContextService` to access the current trace context:

```typescript
import { TraceContextService } from '@relab/nestjs-trace-context'

@Injectable()
export class MyService {
  constructor(private readonly traceContext: TraceContextService) {}

  myMethod() {
    const trace = this.traceContext.getContext()
    // trace: { traceId, spanId, traceFlags }
  }
}
```

---

## API

- **TraceContextModule**: Import into your root module.
- **TraceContextMiddleware**: Apply as middleware for HTTP requests.
- **TraceContextMicroserviceInterceptor**: Automatically applied for microservices via `configureTraceContext`.
- **TraceContextService**: Inject to access or set the current trace context.

---

## License

MIT
npm package: @relab/nestjs-validation
Description: Validation helpers for Nest.js
Author: Sergey Zwezdin
Latest version: 2.7.2

# @relab/nestjs-validation

## Purpose

`@relab/nestjs-validation` provides a reusable helpers for setting up robust, consistent request validation in your NestJS applications. It configures a global validation pipe with automatic transformation and a standardized error response format, making it easier to handle and debug validation errors across your project.

## Features

- **Global Validation Pipe**: Automatically applies validation to all incoming requests.
- **Automatic Transformation**: Converts payloads to expected DTO types.
- **Consistent Error Format**: Returns validation errors in a structured, predictable format.
- **Easy Integration**: Simple, one-line setup for any NestJS app.

## Installation

```bash
pnpm add @relab/nestjs-validation
# or
npm install @relab/nestjs-validation
# or
yarn add @relab/nestjs-validation
```

## How to Use

```typescript
import { configureValidation } from '@relab/nestjs-validation'

const app = /* create nestjs app */

configureValidation(app)
```

This will:

- Enable global validation for all incoming requests.
- Transform request payloads to match your DTOs.
- Return validation errors in the following format:

```json
{
  "statusCode": 400,
  "message": "Validation failed",
  "details": [
    {
      "field": "propertyName",
      "errors": [
        "error message 1",
        "error message 2"
      ]
    }
    // ...more fields
  ]
}
```

## Requirements

- NestJS v11.1.1 or higher

## License

MIT
npm package: @relab/node-logger
Description: Winston logger configuration
Author: Sergey Zwezdin
Latest version: 1.0.2

# @relab/node-logger

Winston-based logger configuration with Telegram integration.

![node-logger](./docs/demo.png)

## Usage

1. `npm install --save @relab/node-logger`
2. Configure layout, verbosity level and Telegram (if necessary)
3. Patch `console` object:
```typescript
import { patchCommonLogger } from '@relab/node-logger'
patchCommonLogger()
```
4. Import `logger` to write logs into default area
5. Import `scoped` to create log area

## Configuration

### Layout
```typescript
import { configureLogger } from '@relab/node-logger'
configureLogger({ kind: 'layout', layout: ['timestamp', 'level', 'area', 'message', 'details', 'error'] })
```

### Verbosity level
```typescript
import { configureLogger } from '@relab/node-logger'
configureLogger({ kind: 'verbosity', verbosity: { area: '*', level: 'error' } })
configureLogger({ kind: 'verbosity', verbosity: { area: 'express', level: 'debug' } })
```

### Telegram
```typescript
import { configureLogger } from '@relab/node-logger'
configureLogger({
    kind: 'telegram',
    telegram: {
        enabled: true,
        token: process.env.LOGGER_TELEGRAM_TOKEN ?? '',
        chatId: Number(process.env.LOGGER_TELEGRAM_CHAT_ID),
    }
})
```

## Example of usage
```typescript
import { patchCommonLogger, logger, scoped, configureLogger } from '@relab/node-logger'

// Configure and patch logger
configureLogger({ kind: 'layout', layout: ['timestamp', 'level', 'area', 'message', 'details', 'error'] })
configureLogger({ kind: 'verbosity', verbosity: { area: '*', level: 'error' } })
configureLogger({ kind: 'verbosity', verbosity: { area: 'express', level: 'debug' } })
configureLogger({
    kind: 'telegram',
    telegram: {
        enabled: true,
        token: process.env.LOGGER_TELEGRAM_TOKEN ?? '',
        chatId: Number(process.env.LOGGER_TELEGRAM_CHAT_ID),
    }
})
patchCommonLogger()

// Create scoped logger
const expressLogger = scoped('express')

// Use logger
logger.info('Starting application')
expressLogger.info('Starting web-server')
expressLogger.error('Unable to start web-server')
console.log('Default message') // also works
```

## License

Released under [MIT](/LICENSE) by [Sergey Zwezdin](https://github.com/sergeyzwezdin).
npm package: @relab/node-manifest
Description: The package allows storing the application manifest for the project and using it as needed.
Author: Sergey Zwezdin
Latest version: 1.0.10

# @relab/node-manifest

The package allows storing the application manifest for the project and using it as needed. 

## Requirements

- Node 18+
- Zod 3+

## Installation

### NPM

```
npm install --save @relab/node-manifest
```

### PNPM

```
npm add @relab/node-manifest
```

## Default project schema

```json5
{
  "name": "<project name>", // Project name
  "description": "<project description>", // Description of the project
  "service": "<service name>", // (optional) Service name - useful, for example, when your app is part of Kubernetes app
  "package": { // (optional) Package description
    "name": "", // Package name
    "description": "", // (optional) Package description
    "version": "", // Package version
  }
}
```

## Usage

### Default schema

`./manifest.json`

```json
{
  "name": "Test",
  "description": "Test app",
  "service": "test",
  "package": {
    "name": "@company/test",
    "description": "Package for test app",
    "version": "1.1.0"
  }
}
```

`./manifest.ts`

```typescript
import { DefaultManifestSchema, manifest as parse } from '@relab/node-manifest'
export const manifest = parse(DefaultManifestSchema)()
```
Somewhere in your app:

```typescript
import manifest from './manifest'

console.log(manifest.name)
console.log(manifest.description)
// ...
```

### Custom schema

`./manifest.json`

```json
{
  "name": "Test",
  "description": "Test app",
  "service": "test",
  "package": {
    "name": "@company/test",
    "description": "Package for test app",
    "version": "1.1.0"
  }
}
```

`./manifest.ts`

```typescript
import { DefaultManifestSchema, manifest as parse } from '@relab/node-manifest'
export const manifest = parse(DefaultManifestSchema)()
```
Somewhere in your app:

```typescript
import manifest from './manifest'

console.log(manifest.name)
console.log(manifest.description)
// ...
```

### Custom manifest file name

`./manifest.json`

```json
{
  "title": "Test",
  "version": "1.1.0"
}
```

`./manifest.ts`

```typescript
import { manifest as parse } from '@relab/node-manifest'
import { z } from 'zod'

const MyManifestSchema = z.object({
    title: z.string(),
    version: z.string(),
})

export const manifest = parse(MyManifestSchema)()
```
Somewhere in your app:

```typescript
import manifest from './manifest'

console.log(manifest.title)
console.log(manifest.version)
```

## License

Released under [MIT](/LICENSE) by [Sergey Zwezdin](https://github.com/sergeyzwezdin).
npm package: @relab/node-welcome
Description: Prints a welcome message along with the configuration parameters.
Author: Sergey Zwezdin
Latest version: 1.0.10

# @relab/node-welcome

Prints a welcome message along with the configuration parameters. 

## Requirements

- Node 18+

## Installation

### NPM

```
npm install --save @relab/node-welcome
```

### PNPM

```
npm add @relab/node-welcome
```

## Usage

```typescript
import { welcome } from '@relab/node-welcome'
import process from 'process'

welcome('My Application', process.env.VERSION || '1.0.0', [
    { key: 'Environment', value: process.env.NODE_ENV },
    { key: 'Log Level', value: process.env.LOG_LEVEL },
    undefined,
    { key: 'Base URL', value: process.env.BASE_URL },
    { key: 'Port', value: process.env.PORT },
    { key: 'Prefix', value: process.env.PATH_PREFIX },
    undefined,
    { key: 'Commit ID', value: process.env.COMMIT_ID },
    { key: 'Branch', value: process.env.BRANCH_NAME },
    { key: 'Build ID', value: process.env.BUILD_ID },
])
// ...
```

## License

Released under [MIT](/LICENSE) by [Sergey Zwezdin](https://github.com/sergeyzwezdin).
npm package: @relab/pino-logger
Description: Pino-based logger configuration with Loki integration.
Author: Sergey Zwezdin
Latest version: 1.0.11

# @relab/pino-logger

Pino-based logger configuration with Loki integration.

## Requirements

- Node 18+

## Installation

### NPM

```
npm install --save @relab/pino-logger
```

### PNPM

```
pnpm add @relab/pino-logger
```

## Setup

### Fastify

```typescript
import Fastify from 'fastify'
import pino from 'pino'
import { loggerOptions, pinoStreams } from '@relab/pino-logger'

const fastify = Fastify({
    logger: {
        enabled: true,
        base: { area: 'http' },
        ...loggerOptions,
        stream: pino.multistream(pinoStreams()),
    },
})
```

## Usage

```typescript
import { logger } from '@relab/pino-logger'

const log = logger('custom-area')

log.info('Hello')
```

## Configuration

There are some environment variables used to configure logger.

| `process.env`    | Description                                                                     | Default |
|------------------|---------------------------------------------------------------------------------|---------|
| `LOG_LEVEL`      | Log level for output to console (`trace`/`debug`/`info`/`warn`/`error`/`fatal`) | `info`  |
| `LOKI_HOST`      | Loki host name                                                                  | Empty   |   
| `LOKI_USERNAME`  | Loki user name                                                                  | Empty   |   
| `LOKI_PASSWORD`  | Loki password                                                                   | Empty   |   
| `LOKI_LOG_LEVEL` | Log level for Loki (`trace`/`debug`/`info`/`warn`/`error`/`fatal`)              | `warn`  |   
| `NAMESPACE`      | App namespace (useful for k8s apps)                                             | Empty   |   
| `HOSTNAME`       | App host name/pod name (useful for k8s apps)                                    | Empty   |   
| `COMMIT_ID`      | Git Commit SHA                                                                  | Empty   |   
| `BRANCH_NAME`    | Git branch name                                                                 | Empty   |   
| `BUILD_ID`       | Build ID                                                                        | Empty   |   


## License

Released under [MIT](/LICENSE) by [Sergey Zwezdin](https://github.com/sergeyzwezdin).
npm package: @relab/prettier-config
Description: Shareable prettier configuration
Author: Sergey Zwezdin
Latest version: 1.2.0

# @relab/prettier-config

Shareable prettier configuration

## Usage

1. Install package `@relab/prettier-config`
```bash
npm install @relab/prettier-config --save-dev
```
2. Specify prettier configuration in `package.json`
```json
{
  "name": "your-package-name",
  "prettier": "@relab/prettier-config",
  "scripts": {
    "format": "prettier --write \"**/*.ts*\""
  }
}
```

## License

Released under [MIT](/LICENSE) by [Sergey Zwezdin](https://github.com/sergeyzwezdin).
npm package: @relab/semantic-release-commits-config
Description: semantic-release shareable config defines standards for commit name conventions
Author: Sergey Zwezdin
Latest version: 0.0.10

# @relab/semantic-release-commits-config

[**semantic-release**](https://github.com/semantic-release/semantic-release) shareable config defines standards for commit name conventions.

## Plugins

This shareable configuration use the following plugins:

-   [`@semantic-release/commit-analyzer`](https://github.com/semantic-release/commit-analyzer)
-   [`@semantic-release/release-notes-generator`](https://github.com/semantic-release/release-notes-generator)

## Install

```bash
$ npm install --save-dev semantic-release @relab/semantic-release-commits-config
```

## Usage

The shareable config can be configured in the [**semantic-release** configuration file](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration):

**package.json**:

```json
{
    "extends": "@relab/semantic-release-commits-config"
}
```

**.release.rc.js**:

```javascript
const common = require('@relab/semantic-release-commits-config')

module.exports = {
    ...common,
    plugins: [
        ...common.plugins,
        /* your plugins here */
    ],
}
```

## Configuration

See each [plugin](#plugins) documentation for required installation and configuration steps.