open-index/open-npm huggingface dataset:
npm package: @nlevchuk/tg-message-translator
Description: A plugin that translates incoming messages
Author: Nikita Levchuk
Latest version: 1.0.1

## TG Message Translator

![NPM Version](https://img.shields.io/npm/v/%40nlevchuk%2Ftg-message-translator?labelColor=cb3837)

The plugin translates incoming messages from Telegram bots developed with the [Grammy](https://grammy.dev/) package.
npm package: @nlevchuk/tg-misc
Description: A tiny plugin for applications built using the Grammy package
Author: Nikita Levchuk
Latest version: 1.0.2

## TG Misc

![NPM Version](https://img.shields.io/npm/v/%40nlevchuk%2Ftg-misc?labelColor=cb3837)

The plugin provides a set of common functions utilized by applications built with the [Grammy](https://grammy.dev/) package
npm package: @nlevo/apidoc-swagger
Description: Convert api doc json to swagger json
Author: Bahman Fakhr Sabahi
Latest version: 0.4.0

# apidoc-swagger

Note: The original package would not work with @apiSchema (apidoc-plugin-schema) and it seems to be no longer maintained.

Apidoc and Swagger are two nice projects which are focusing on documentation of APIs. 
This project is a middle tier which tries to bring them together in a sense that:
> It uses apidoc to convert inline documentation comments into json schema and later convert it to swagger json schmea.


## HOW IT WORKS

### OPTION 1:

***(uses [apidoc-core](https://github.com/apidoc/apidoc-core) library)***

APIDOC_INLINE_COMMENTS_IN_CODE -> APIDOC (json) -> SWAGGER (json)

Note: if your inline comments contain `@apiSchema` then this option won't work (use option 2). This is due to apidoc-core not supporting `apidoc-plugin-schema` at the time of writing.

By putting inline comments in the source code like this in javascript, you will get `swagger.json` file which can be served to [swagger-ui](https://github.com/swagger-api/swagger-ui) to generate html overview of documentation.

`/api/foo.js`:
```js
/**
 * @api {get} /user/id Request User information
 * @apiName GetUser
 * @apiGroup User
 *
 * @apiParam {Number} id Users unique ID.
 *
 * @apiSuccess {String} firstname Firstname of the User.
 * @apiSuccess {String} lastname  Lastname of the User.
 */
```

### EXAMPLE

`apidoc-swagger --input path_to_api_project/ --output ./nginx/www/swagger/`

### OPTION 2: 
APIDOC -> SWAGGER

For this option to work, you need to convert APIDOC_INLINE_COMMENTS_IN_CODE to APIDOC(json) yourself, for example using [apidoc.js](https://www.npmjs.com/package/apidoc)

### EXAMPLE

`apidoc-swagger --useApidocJson --input ./api_project.json --apidocDataInput ./api_data.json --output ./nginx/www/swagger/`


## Installation

`npm install @nlevo/apidoc-swagger -g`


Have a look at [apidoc](https://github.com/apidoc/apidoc) for full functionality overview and capabilities of apidoc.

To read more about how swagger works refer to [swagger-ui](https://github.com/swagger-api/swagger-ui) and [swagger-spec](https://github.com/swagger-api/swagger-spec) for details of `swagger.json`.
npm package: @nlf/cli-logger
Description: a logger that i use for cli tools
Author: Nathan LaFreniere
Latest version: 1.1.0

### cli-logger

This is a small logger that I wrote for usage in my own cli tools. It's pretty much meant to fit my needs and that's it. If it's useful for you too, awesome.

### API

#### `new Logger({ name, level, format })`

Create a new logger instance. The options are as follows:

- `name`: if provided, this will log as part of each entry made by this logger instance. This is mostly useful if you have multiple sources of logs in your app and want them to be distinguished from each other.
- `level`: the minimum level that log entries must match before they're actually printed. the default is `'info'` and may be set to one of `'debug'`, `'info`', `'warn'`, or `'error'`
- `format`: the format to print the timestamp in, this is passed directly to [dateformat](https://github.com/felixge/node-dateformat) and defaults to `'HH:MM:ss.l'`.
- `hrtime`: measure timers using `process.hrtime()` (or `process.hrtime.bigint()` if available) and print more detailed time strings, defaults to `false`

#### `logger.debug()`, `logger.info()`, `logger.warn()`, `logger.error()`

Log an entry with the given level. Arguments are passed directly to [util.format]() and prepended with a timestamp, the level as a string, and if provided your logger's name.

#### `logger.count(id, level)`

Log a count of an entry. Any log line that is given the same `id` will increment the count and print both the `id` and the number of times that id (at the same level) has been called. The `level` parameter is optional and defaults to `'info'`.

#### `logger.time(id, level)`

Start a timer with the given `id` (`level` is optional, and defaults to `'debug'`). A log entry will be printed at the given level with a message informing the user the timer has started.

#### `logger.timeEnd(id, level)`

End the timer with the given `id` (`level` is optional, and defaults to `'info'`). A log entry will be printed at the given level with a message informing the user the timer has finished, as well as how much time elapsed since the timer started. Note that unlike `logger.count()`, the `level` here does not need to match the `level` given to `logger.time()`.
npm package: @nlfmt/rapid
Description: Rapidly create typesafe routes for your express application
Author: nlfmt
Latest version: 1.1.0

# Rapid
Rapidly create typesafe routes for your express application.

# Installation
Just add the package `@nlfmt/rapid` using your favorite package manager
```sh
    pnpm add @nlfmt/rapid
```

## Features
### Zod
Rapid uses [Zod](https://zod.dev/) to validate the request body, query parameters, cookies and route parameters for you. \
This allows you to define the shape of the data you expect to receive and Rapid will automatically validate it for you.

### Typesafe reusable Middleware
Using Rapid, you can define Middleware functions that add context to the route handler. \
They can build on top of each other easily and are fully typesafe.

## Examples
```ts
    import { createRouter } from "@nlfmt/rapid"
    import express from "express"
    import z from "zod"

    apiRouter
      .path("/user/:userId")
      .params({
        // rapid automatically infers the param names from the url
        userId: z.string().min(1),
      })
      .body(
        z.object({
          username: z.string().regex(
            /^[a-zA-Z1-9_.]{3,}$/g,
            "Username can only contain letters, underscores and dots"
          ),
          password: z.string().min(6)
        })
      )
      // rapid performs the input validation for you
      // and types `body`, `params` and more accordingly
      .put(({ body, params }) => {
        const user = db.user.findById(params.userId)
        if (!user)
          throw new ApiError({
            code: 404,
            name: "NOT_FOUND",
            message: "User not found",
          })
        
        return db.user.updateById(params.userId, body)
      })

    const app = express()
    app.use(express.json())
    app.use("/api", apiRouter.router)

    app.listen(3000)
```
For more examples, check out the [examples](examples) directory.


## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
npm package: @nlfmt/stormdb
Description: A simple typesafe JSON ORM Database with advanced querying and object serialization. Supports NodeJS and Electron
Author: nlfmt
Latest version: 2.0.0

# Storm DB
A **S**imple **T**ypescript **ORM** for NodeJS. Supports custom class serialization and deserialization, advanced querying, and more.

## Disclaimer
### Pros
StormDB is a good choice for projects, that need a simple typesafe database, that works out of the box. \
Since all the data is stored in JSON (or a format of your choice), you dont have to set up anything like a server. \
StormDB can be used in any project you wish, as it is very lightweight.

### Cons
StormDB is **NOT** a good choice to store large amounts of data, as it loads the entire database into memory. \
It is also not suitable for applications that need very fast data access. Even though StormDB is quite fast, as the data is stored in memory, \
it doesnt do any querying optimizations, like indexing.


## Quickstart
1. Install StormDB `npm install @nlfmt/stormdb`
2. Install packages for you validation library, here are some examples:
   - `npm install zod @typeschema/zod`
   - `npm install valibot @typeschema/valibot`
3. Initialize the database
```ts
import StormDB from '@nlfmt/stormdb';
import { z } from 'zod';

const userModel = z.object({
  name: z.string(),
  age: z.number(),
});

const db = StormDB({ user: userModel }, { storage: "db.json" });
```
4. Use the querying API
```ts
// Add a user
let usr = await db.user.create({ name: "John", age: 20 });

// Get a user
usr = await db.user.findById(usr._id);
usr = await db.user.find({ name: "John" });

// Update a user
usr = await db.user.updateById(usr._id, { age: 21 });
usr = await db.user.update({ name: "John" }, { age: 21 });

// Delete a user
await db.user.deleteById(usr._id);
```
## Examples
For more examples, check out the `examples` folder.

## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
npm package: @nlfr/fa2.1-sdk
Description: ## Features
Latest version: 0.4.2

# FA2.1 - SDK

## Features

- **Lambda Functions:** Easy-to-use lambda functions for common tasks and workflows.
- **Type Safety:** Strongly-typed interfaces and types for [specific standard or technology], ensuring code reliability and maintainability.
- **Utility Helpers:** A collection of utility functions to perform routine tasks more efficiently.
- **[Other Features]:** Briefly describe other notable features of your SDK.

## Installation

Install [Your SDK Library Name] using npm:

```bash
npm install [your-sdk-library-name]
```

Or using Yarn:

```bash
yarn add [your-sdk-library-name]
```

## Usage

Here's a quick example to get you started:

```typescript
import { someFunction, someType } from '[your-sdk-library-name]';

// Example usage
const result = someFunction();
```

## Documentation

For detailed documentation, including all available functions and types, visit [Link to Documentation].

## Examples

Check out our examples folder for more usage scenarios and code samples.

## Contributing

Contributions are always welcome! Please read our Contributing Guide for more information.

## Support and Feedback

If you have any issues or feedback, please file an issue.

## License

[Your SDK Library Name] is MIT licensed.