open-index/open-npm huggingface dataset:
npm package: @sodefa/next-server-context
Description: The missing server context for Next.js App Directory.
Author: Tristan Rechenberger
Latest version: 0.0.3

# Next Server Context

The missing server context for Next.js App Directory.

## Install

```bash
pnpm add @sodefa/next-server-context
```

## Page Context

/app/[myParam]/page.tsx

```tsx
import { pageContext } from '@sodefa/next-server-context'
import { NestedServerComponent } from './NestedServerComponent'

export default pageContext.Wrapper(({ params, searchParams }) => {
  return (
    <>
      <h1>MyPage</h1>
      <NestedServerComponent />
    </>
  )
})
```

/app/[myParam]/NestedServerComponent.tsx

```tsx
import { pageContext } from '@sodefa/next-server-context'

export const NestedServerComponent = () => {
  const { params, searchParams } = pageContext.getOrThrow()
  return <div>NestedServerComponent: {params.myParam}</div>
}
```

## Custom Context

/myContext.ts

```ts
import { createServerContext } from '@sodefa/next-server-context'

const myContext = createServerContext<{
  myValue: string
}>()
```

/ParentComp.tsx

```tsx
import { myContext } from './myContext'

export const ParentComp = () => {
  myContext.set({ myValue: 'hi there' })
  return <ChildComp />
}
```

/ChildComp.tsx

```tsx
import { myContext } from './myContext'

export const ChildComp = () => {
  const { myValue } = myContext.getOrThrow()
  return <div>ChildComp: {myValue}</div>
}
```

## Zod Context

/app/zod/[singleParam]/[...deepParams]/myContext.ts

```ts
import { createServerContextWithZod } from '@sodefa/next-server-context'
import { z } from 'zod'

export const myContext = createServerContextWithZod(
  z.object({
    params: z.object({
      singleParam: z.string(),
      deepParams: z.array(z.string()),
    }),
    searchParams: z
      .object({
        p1: z.string().optional(),
        p2: z.array(z.string()).optional(),
      })
      .catchall(z.union([z.string(), z.array(z.string())])), // Allow additional search params (optional)
  })
)
```

/app/zod/[singleParam]/[...deepParams]/page.tsx

```tsx
import { NestedServerComponent } from './NestedServerComponent'
import { myContext } from './myContext'

export default myContext.Wrapper(() => {
  return (
    <>
      <h1>Page with a lot of Params</h1>
      <NestedServerComponent />
    </>
  )
})
```

/app/zod/[singleParam]/[...deepParams]/NestedServerComponent.tsx

```tsx
import { myContext } from './myContext'

export const NestedServerComponent = () => {
  const { params, searchParams } = myContext.getOrThrow()
  return (
    <pre className="p-2 border rounded flex flex-col gap-4 font-mono text-xs ">
      {JSON.stringify({ params, searchParams }, null, 2)}
    </pre>
  )
}
```
npm package: @sodisa/dialog
Description: Modal dialog
Author: betoecs
Latest version: 1.0.12

# dialog

> Modal dialog

[![NPM](https://img.shields.io/npm/v/dialog.svg)](https://www.npmjs.com/package/dialog) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save dialog
```

## Usage

```jsx
import React, { Component } from 'react'

import MyComponent from 'dialog'

class Example extends Component {
  render () {
    return (
      <MyComponent />
    )
  }
}
```

## License

MIT © [betoecs](https://github.com/betoecs)
npm package: @sodisa/nav
Description: >
Author: betoecs
Latest version: 1.0.3

# nav

> 

[![NPM](https://img.shields.io/npm/v/nav.svg)](https://www.npmjs.com/package/nav) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save nav
```

## Usage

```jsx
import React, { Component } from 'react'

import MyComponent from 'nav'

class Example extends Component {
  render () {
    return (
      <MyComponent />
    )
  }
}
```

## License

MIT © [betoecs](https://github.com/betoecs)
npm package: @sodiumlabs/cache
Description: Lightweight and performant caching utilities
Author: sodiumlabs
Latest version: 1.0.0

<div align="center">
    <h1>@sodiumlabs/cache</h1>
    <p>
        <a href="https://discord.gg/8PDXWSHH7k"><img src="https://img.shields.io/badge/join_us-on_discord-5865F2?logo=discord&logoColor=white" alt="Discord server" /></a>
        <a href="https://www.npmjs.com/package/@sodiumlabs/cache"><img src="https://img.shields.io/npm/v/@sodiumlabs/cache.svg?maxAge=3600" alt="npm version" /></a>
        <a href="https://www.npmjs.com/package/@sodiumlabs/cache"><img src="https://img.shields.io/npm/dt/@sodiumlabs/cache.svg?maxAge=3600" alt="npm downloads" /></a>
        <a href="https://github.com/sodium-labs/utilities/commits/main/packages/cache"><img alt="Last commit" src="https://img.shields.io/github/last-commit/sodium-labs/utilities?logo=github&logoColor=ffffff&path=packages%2Fcache" /></a>
    </p>
</div>

## About

A lightweight and performant caching library providing simple TTL-based caches for single values and key-value maps.

## Installation

Node.js 18 or newer is required.

```sh
npm install @sodiumlabs/cache
```

## Usage

Cache

```ts
import { Cache } from "@sodiumlabs/cache";

// values are cached for 60s:
const cache = new Cache({ ttl: 60_000 });

cache.set("some key", 10);

cache.get("some key"); // 10
cache.has("some key"); // true
cache.set("some key", 10, 10_000); // override the default TTL with 10s

await sleep(11_000);

cache.has("some key"); // false
```

ValueCache

```ts
import { ValueCache } from "@sodiumlabs/cache";

const value = new ValueCache({ ttl: 10_000 }).set("some value");

value.get(); // "some value"

await sleep(11_000);

value.get(); // undefined
```

## Links

- [Documentation](https://docs.sodiumlabs.xyz/docs/packages/cache/stable)
- [Discord server](https://discord.gg/8PDXWSHH7k)
- [GitHub](https://github.com/sodium-labs/utilities/tree/main/packages/cache)
- [npm](https://npmjs.com/package/@sodiumlabs/cache)
- [Sodium Labs](https://sodiumlabs.xyz)

## Help

Need help with the module? Ask on our [support server!](https://discord.gg/8PDXWSHH7k)
npm package: @sodiumlabs/duration
Description: Time and duration utility package
Author: sodiumlabs
Latest version: 1.0.2

<div align="center">
    <h1>@sodiumlabs/duration</h1>
    <p>
        <a href="https://discord.gg/8PDXWSHH7k"><img src="https://img.shields.io/badge/join_us-on_discord-5865F2?logo=discord&logoColor=white" alt="Discord server" /></a>
        <a href="https://www.npmjs.com/package/@sodiumlabs/duration"><img src="https://img.shields.io/npm/v/@sodiumlabs/duration.svg?maxAge=3600" alt="npm version" /></a>
        <a href="https://www.npmjs.com/package/@sodiumlabs/duration"><img src="https://img.shields.io/npm/dt/@sodiumlabs/duration.svg?maxAge=3600" alt="npm downloads" /></a>
        <a href="https://github.com/sodium-labs/utilities/commits/main/packages/duration"><img alt="Last commit" src="https://img.shields.io/github/last-commit/sodium-labs/utilities?logo=github&logoColor=ffffff&path=packages%2Fduration" /></a>
    </p>
</div>

## About

Time and duration utility package.

## Installation

Node.js 18 or newer is required.

```sh
npm install @sodiumlabs/duration
```

## Usage

```ts
import { Time } from "@sodiumlabs/duration";

setInterval(() => {
    console.log("Called every 2 hours!");
}, Time.Hour * 2);
```

## Links

- [Documentation](https://docs.sodiumlabs.xyz/docs/packages/duration/stable)
- [Discord server](https://discord.gg/8PDXWSHH7k)
- [GitHub](https://github.com/sodium-labs/utilities/tree/main/packages/duration)
- [npm](https://npmjs.com/package/@sodiumlabs/duration)
- [Sodium Labs](https://sodiumlabs.xyz)

## Help

Need help with the module? Ask on our [support server!](https://discord.gg/8PDXWSHH7k)
npm package: @sodiumlabs/gdapi
Description: An unofficial Geometry Dash API wrapper
Author: sodiumlabs
Latest version: 1.0.3

<div align="center">
<br />
    <h1>GD API</h1>
    <br />
    <p>
        <a href="https://discord.gg/8PDXWSHH7k"><img src="https://img.shields.io/discord/1336303640725553213?color=5865F2&logo=discord&logoColor=white" alt="Discord server" /></a>
        <a href="https://www.npmjs.com/package/@sodiumlabs/gdapi"><img src="https://img.shields.io/npm/v/@sodiumlabs/gdapi.svg?maxAge=3600" alt="npm version" /></a>
        <a href="https://www.npmjs.com/package/@sodiumlabs/gdapi"><img src="https://img.shields.io/npm/dt/@sodiumlabs/gdapi.svg?maxAge=3600" alt="npm downloads" /></a>
        <a href="https://github.com/sodium-labs/gdapi/commits/main"><img alt="Last commit" src="https://img.shields.io/github/last-commit/sodium-labs/gdapi?logo=github&logoColor=ffffff" /></a>
    </p>
</div>

# About

GD API is a module that allows you to easily interact with the Geometry Dash private API. The module documentation is available at [https://docs.sodiumlabs.xyz](https://docs.sodiumlabs.xyz/docs/packages/gdapi/stable).

This module does not include all features of the Geometry Dash API, such as endpoints that require user passwords. However, you can combine it with the knowledge from the [unofficial GD docs](https://wyliemaster.github.io/gddocs) to access everything if needed.

# Installation

```sh
npm install @sodiumlabs/gdapi@latest
```

# Links

- [Documentation](https://docs.sodiumlabs.xyz/docs/packages/gdapi/stable)
- [Unofficial GD docs](https://wyliemaster.github.io/gddocs)
- [Discord server](https://discord.gg/8PDXWSHH7k)
- [GitHub](https://github.com/sodium-labs/gdapi)
- [npm](https://npmjs.com/package/@sodiumlabs/gdapi)
- [Sodium Labs](https://sodiumlabs.xyz)
- [Geometry Dash](https://www.geometrydash.com)

# Example

```js
import { GDAPI } from "@sodiumlabs/gdapi";

const gdapi = new GDAPI();

// Get RobTop account
const user = await gdapi.getUserById(71);
console.log(user);
```

# Help

If you don't understand something in the documentation, are experiencing problems, or you just need a gentle nudge in the right direction, please don't hesitate to join our official [Discord Server](https://discord.gg/8PDXWSHH7k).
npm package: @sodiumlabs/snowflake
Description: Snowflake utility package
Author: sodiumlabs
Latest version: 1.0.3

<div align="center">
    <h1>@sodiumlabs/snowflake</h1>
    <p>
        <a href="https://discord.gg/8PDXWSHH7k"><img src="https://img.shields.io/badge/join_us-on_discord-5865F2?logo=discord&logoColor=white" alt="Discord server" /></a>
        <a href="https://www.npmjs.com/package/@sodiumlabs/snowflake"><img src="https://img.shields.io/npm/v/@sodiumlabs/snowflake.svg?maxAge=3600" alt="npm version" /></a>
        <a href="https://www.npmjs.com/package/@sodiumlabs/snowflake"><img src="https://img.shields.io/npm/dt/@sodiumlabs/snowflake.svg?maxAge=3600" alt="npm downloads" /></a>
        <a href="https://github.com/sodium-labs/utilities/commits/main/packages/snowflake"><img alt="Last commit" src="https://img.shields.io/github/last-commit/sodium-labs/utilities?logo=github&logoColor=ffffff&path=packages%2Fsnowflake" /></a>
    </p>
</div>

## About

Utility package to generate and deconstruct snowflakes. Snowflakes are unique IDs sortable by time and containing their creation timestamp within themselves. Read more about snowflakes on [Wikipedia](https://en.wikipedia.org/wiki/Snowflake_ID).

## Installation

Node.js 18 or newer is required.

```sh
npm install @sodiumlabs/snowflake
```

## Usage

Using snowflakes

```ts
import { Snowflake } from "@sodiumlabs/snowflake";

const epoch = new Date("2020-01-01T00:00:00.000Z");

// Create an instance of Snowflake
const snowflake = new Snowflake(epoch);

// Generate a snowflake with the given epoch
const uniqueId = snowflake.generate();
```

Snowflakes with Discord

```ts
import { discordSnowflake } from "@sodiumlabs/snowflake";

// Extract only the timestamp from a snowflake
const timestamp = discordSnowflake.timestampFrom("716068012414730320");
// 1590794318060

// Deconstruct the snowflake
const data = discordSnowflake.deconstruct("716068012414730320");
// {
//   id: 716068012414730320n,
//   timestamp: 1590794318060n,
//   workerId: 0n,
//   processId: 0n,
//   increment: 80n,
//   epoch: 1420070400000n
// }
```

## Links

- [Documentation](https://docs.sodiumlabs.xyz/docs/packages/snowflake/stable)
- [Discord server](https://discord.gg/8PDXWSHH7k)
- [GitHub](https://github.com/sodium-labs/utilities/tree/main/packages/snowflake)
- [npm](https://npmjs.com/package/@sodiumlabs/snowflake)
- [Sodium Labs](https://sodiumlabs.xyz)

## Help

Need help with the module? Ask on our [support server!](https://discord.gg/8PDXWSHH7k)

## Credits

This project also partially contains code derived or copied from [@sapphire/snowflake](https://github.com/sapphiredev/utilities/tree/main/packages/snowflake).