open-index/open-npm huggingface dataset:
npm package: @nexterias/eslint-config
Description: ESLint configuration for NEXTERIAS projects
Author: The NEXTERIAS
Latest version: 1.0.0

# @nexterias/eslint-config

ESLint configuration for NEXTERIAS projects

## Quick start

### 1. Installation

```bash
$ npm i -D eslint @nexterias/eslint-config
$ pnpm i -D eslint @nexterias/eslint-config
$ bun add -D eslint @nexterias/eslint-config
$ yarn add -D eslint @nexterias/eslint-config
```

### 2. Configuration

Paste the code below into eslint.config.js!

```js
import config from '@nexterias/eslint-config'

export default config
```

## Presets

### React

```bash
$ npm i -D eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-jsx-a11y
$ pnpm i -D eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-jsx-a11y
$ bun add -D eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-jsx-a11y
$ yarn add -D eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-jsx-a11y
```

```js
import config from '@nexterias/eslint-config'
import react from '@nexterias/eslint-config/presets/react'

export default [...config, ...react]
```
npm package: @nexterias/hono-cookie-signature
Description: A library for cookie signing and verification using HMAC-SHA256 for Hono.
Latest version: 1.0.1
Deprecated: Use the official cookie middleware

# @nexterias/hono-cookie-signature

A library for cookie signing and verification using HMAC-SHA256 for Hono.

[![Documentation](https://github.com/nexterias/hono-session-signature/actions/workflows/docs.yml/badge.svg)](https://github.com/nexterias/hono-session-signature/actions/workflows/docs.yml)
[![Testing](https://github.com/nexterias/hono-session-signature/actions/workflows/tests.yml/badge.svg)](https://github.com/nexterias/hono-session-signature/actions/workflows/tests.yml)

## Usage

```js
import { Hono } from 'hono'
import { zValidator } from '@hono/zod-validator'
import { z } from 'zod'
import {
  cookieSignature,
  importKey,
  getVerifiedCookie,
  setCookieWithSignature,
} from '@nexterias/hono-cookie-signature'

const app = new Hono()
const secret = await importKey(new TextEncoder().encode('THIS_IS_SECRET_KEY'))
const setCookie = setCookieWithSignature(secret)
const cookies = {
  firstName: 'first_name',
  lastName: 'last_name',
}

app.use('/verify', cookieSignature({ secret, cookies: Object.values(cookies) }))
app.get('/verify', (context) => {
  const firstName = getVerifiedCookie(cookies.firstName)
  const lastName = getVerifiedCookie(cookies.lastName)

  return context.json({ message: `Hi! ${firstName} ${lastName} :)` })
})

app.post(
  '/sign',
  zValidator(
    'form',
    z.object({
      firstName: z.string().min(1).max(30),
      lastName: z.string().min(1).max(30),
    })
  ),
  async (context) => {
    const { firstName, lastName } = context.req.valid('form')

    await setCookie(context, cookies.firstName, firstName, {
      path: '/',
      httpOnly: true,
    })
    await setCookie(context, cookies.lastName, lastName, {
      path: '/',
      httpOnly: true,
    })

    return context.redirect('/verify')
  }
)

export default app
```