open-index/open-npm huggingface dataset:
npm package: @regraf/session-redis
Description: Redis powered session middleware for Regraf
Author: Vitaly Domnikov
Latest version: 5.1.1

[![NPM Version](https://img.shields.io/npm/v/@refraf/session-redis.svg?style=flat-square)](https://www.npmjs.com/package/@regraf/session-redis)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](http://standardjs.com/)

# Redis session middleware for Regraf

Redis powered session middleware for [Regraf](https://github.com/regraf/session-redis).

## Installation

```js
$ npm install @regraf/session-redis
```

## Example

```js
const Regraf = require('regraf')
const RedisSession = require('@regraf/session-redis')

const bot = new Regraf(process.env.BOT_TOKEN)

const session = new RedisSession({
  store: {
    host: process.env.TELEGRAM_SESSION_HOST || '127.0.0.1',
    port: process.env.TELEGRAM_SESSION_PORT || 6379
  }
})

bot.use(session)

bot.on('text', (ctx) => {
  ctx.session.counter = ctx.session.counter || 0
  ctx.session.counter++
  console.log('Session', ctx.session)
})

bot.launch()
```

When you have stored the session key beforehand, you can access a
session without having access to a context object. This is useful when
you perform OAUTH or something similar, when a REDIRECT_URI is called
on your bot server.

```js
const redisSession = new RedisSession()

// Retrieve session state by session key
redisSession.getSession(key)
  .then((session) => {
    console.log('Session state', session)
  })

// Save session state
redisSession.saveSession(key, session)
```

## API

### Options

* `store`:
  * `host`: Redis host (default: *127.0.0.1*)
  * `port`: Redis port (default: *6379*)
  * `path`: Unix socket string
  * `url`:  Redis url
  * `...`: [Other redis connection options](http://redis.js.org/#api-rediscreateclient)
* `property`: context property name (default: `session`)
* `ttl`: session ttl in seconds (default: forever)
* `getSessionKey`: session key resolver function `(ctx) => any`)

Default implementation of `getSessionKey`:

```js
function getSessionKey (ctx) {
  if (!ctx.from || !ctx.chat) {
    return
  }
  return `${ctx.from.id}:${ctx.chat.id}`
}
```

### Destroying a session

To destroy a session simply set it to `null`.

```js
bot.on('text', (ctx) => {
  ctx.session = null
})

```
npm package: @regrapes/access-db-parser
Description: A pure javascript Microsoft AccessDB files (.mdb, .accdb) parser
Author: Torsten Blindert
Latest version: 2.0.2

# @regrapes/access-db-parser

Forked from [QuentinJanuel/AccessDB-parser](https://github.com/QuentinJanuel/AccessDB-parser)
which was originally a rewrite of the python package [claroty/access_parser](https://github.com/claroty/access_parser)
## Use

```ts
import { AccessParser } from "@regrapes/access-db-parser";
import fs from 'fs'

// Load your access file in a node buffer
const dbFile = fs.readFileSync('./YOUR_FILE.accdb')

const db = new AccessParser(myFileBuffer);

const tables = db.getTables(); // -> ["tableName1", "tableName2"]

const table = db.parseTable("tableName1"); // -> [{data: {name: "John", age: 23}, rowNumber: 1},{data: {name: "Bill", age: 56}, rowNumber: 2}]
```

## Special thanks

- https://github.com/QuentinJanuel/AccessDB-parser
- https://github.com/claroty/access_parser
npm package: @regrapes/babel-plugin-add-react-memo-displayname
Description: Automatically detects and sets displayName on memo and / or forwardRef wrapped React components
Author: Torsten Blindert
Latest version: 1.0.0

# @regrapes/babel-plugin-add-react-memo-displayname

Automatically detects and sets displayName  on memo and / or forwardRef wrapped React components

## Installation

Simplay add `@regrapes/add-react-memo-displayname` to your `.babelrc` file:

```json
{
  "plugins": ["@regrapes/add-react-memo-displayname"]
}
```
npm package: @regrapes/eslint-config
Description: REGRAPES best practice eslint config
Author: REGRAPES GmbH
Latest version: 2.0.1

# @regrapes/eslint-config
REGRAPES best practice eslint config

## Installation
Install using npm as dev dependency:
```bash
npm i -D @regrapes/eslint-config
```

## Usage
The eslint rules are splitted to fit most use cases

### Basic *(without React and Prettier)*
`package.json`:
```json
{
  "eslintConfig": {
    "extends": "@regrapes/eslint-config"
  }
}
```

### with Prettier
this package comes with a prettier configuration. Simply add the following line to your `package.json`:
```json
{
  "prettier": "@regrapes/eslint-config/prettier"
}
```

If you want eslint to lint prettier rules, also add
```json
{
  "eslintConfig": {
    "extends": [
        "@regrapes/eslint-config",
        "@regrapes/eslint-config/rules/prettier"
    ]
  }
}
```

**Note:** 
Keep in mind that prettier linting can make a significant performance impact.
If you expirience slow linting, remove the eslint rule and refer to [vscode.md](./docs/vscode.md).

If you want eslint to lint prettier only in your CI pipelines due to performance issues use the rule
`@regrapes/eslint-config/rules/prettier-ci`

### with React
`package.json`:
```json
{
  "eslintConfig": {
    "extends": [
      "@regrapes/eslint-config",
      "@regrapes/eslint-config/rules/react",
    ]
  }
```

## Lint Script *(CI)*
`package.json`:
```json
{
  "scripts": {
    "lint": "eslint --max-warnings 0 --ext js,jsx,ts,tsx --cache src"
  }
```

`--max-warnings 0` ensures that CI pipelines will fail on any warning

## git
Add `.eslintcache` to your `.gitignore`