open-index/open-npm huggingface dataset:
npm package: @nextjournal/codemirror-autocomplete
Description: Autocompletion for the CodeMirror code editor
Author: Marijn Haverbeke
Latest version: 0.17.5-rc1

# @codemirror/autocomplete [![NPM version](https://img.shields.io/npm/v/@codemirror/autocomplete.svg)](https://www.npmjs.org/package/@codemirror/autocomplete)

[ [**WEBSITE**](https://codemirror.net/6/) | [**DOCS**](https://codemirror.net/6/docs/ref/#autocomplete) | [**ISSUES**](https://github.com/codemirror/codemirror.next/issues) | [**FORUM**](https://discuss.codemirror.net/c/next/) | [**CHANGELOG**](https://github.com/codemirror/autocomplete/blob/main/CHANGELOG.md) ]

This package implements autocompletion for the
[CodeMirror](https://codemirror.net/6/) code editor.

The [project page](https://codemirror.net/6/) has more information, a
number of [examples](https://codemirror.net/6/examples/) and the
[documentation](https://codemirror.net/6/docs/).

This code is released under an
[MIT license](https://github.com/codemirror/autocomplete/tree/main/LICENSE).

We aim to be an inclusive, welcoming community. To make that explicit,
we have a [code of
conduct](http://contributor-covenant.org/version/1/1/0/) that applies
to communication around the project.
npm package: @nextjs-uploader/s3
Description: NextJS Uploader S3 Adapter
Author: NextJS Uploader Team
Latest version: 0.0.12

# 🎉 nextjs-uploader

一个基于 **Next.js 15** 和 **React 19** 的上传组件，旨在通过 `serverAction` 简化上传流程。
![Demo](docs/main.png)

## 🌐 Language Switch

- [English Version](./README.EN.md)

## 🚀 特性

- **单文件上传** 🗂️：支持简单的单文件上传。
- **多文件上传** 📁：轻松选择和上传多个文件。
- **自定义上传区域** 🎨：可以自定义文件上传区域的样式和功能。
- **自定义上传列表渲染** 📝：灵活渲染上传文件的列表，满足不同需求。
- **S3 适配能力** ☁️：提供与 AWS S3 的无缝集成，便于文件存储。

## 📦 安装

使用 npm 或 yarn 安装：

```bash
npm install nextjs-uploader
# 或者
yarn add nextjs-uploader
```

## 🌟 使用示例

### 使用

#### 1. 创建`action.js`文件，并导出`getSignedUrl`方法

> 插件默认采用基于环境变量的加载机制，当然你也可以自定义配置，实现基于数据库或者其他配置文件的方式来实例化存储插件

```typescript
'use server'

import { S3UploaderProvider } from '@nextjs-uploader/s3'
/**
 * 定义签名获取ServerAction
 */
export async function getSignedUrl(fileName: string) {
  const provider = createS3Uploader()
  return provider.getSignedUrl(provider.createKey(fileName))
}
```

#### 3. 创建环境变量`.env`文件

```bash
# AWS S3存储桶的名称
S3_BUCKET_NAME=
# 用于访问AWS S3的访问密钥ID
S3_ACCESS_KEY_ID=
# 访问AWS S3的秘密访问密钥
S3_SECRET_ACCESS_KEY=
# S3服务的端点URL
S3_ENDPOINT=
# S3存储桶所在的区域
S3_REGION=
# 与S3配合使用的CDN（内容分发网络）
S3_CDN=
# 存储服务提供商的名称或类型 (awz,kodo(七牛云)，oss(阿里云),cos(腾讯云))
S3_PROVIDER=awz
```

#### 4. 前端封装上传函数

```typescript
import { getSignedUrl } from './action'

const handleUpload = async (file: File) => {
  const { url, formData, link } = await getSignedUrl(file.name)
  // 补充file
  formData.append('file', file)
  const response = await fetch(url, {
    method: 'POST',
    body: formData,
  })
  if (response.ok) {
    console.log('upload success', link)
    return link
  } else {
    console.error('upload failed', response.statusText)
    throw new Error(response.statusText)
  }
}
```

#### 5. 在定义一个简单的组件来上传

```typescript
'use client'

export function SimpleUpload() {
  // 定义状态：0：未上传，1：上传中，2：上传成功，3：上传失败
  const [state, setState] = useState(0)
  const [link, setLink] = useState('')

  const handleUpload = async (file: File) => {
    setState(1)
    try {
      const link = await uploadFile(file)
      setState(2)
      setLink(link)
    } catch (error) {
      setState(3)
      console.error(error)
    }
  }
  return (
    <div>
      <Input type='file' onChange={(e) => e.target?.files?.[0] && handleUpload(e.target.files[0]) } />
      <div>
        {state === 0 && '未上传'}
        {state === 1 && '上传中...'}
        {state === 2 && (
          <div>
           上传成功：
            <a target='_blank' href={link}> {link} </a>
          </div>
        )}
        {state === 3 && '上传失败'}
      </div>
    </div>
  )
}

```

## 🤝 贡献

欢迎贡献！请查看 [贡献指南](./CONTRIBUTING.md) 了解更多信息。
npm package: @nextjs-utils/sane-link
Description: A replacement for `@next/link` that is replaced by an `a` tag for external sites.
Author: Kevin Romero Peces-Barba
Latest version: 0.1.1

# `dynamic-react-icons`

> TODO: description

## Usage

```
const dynamicReactIcons = require('dynamic-react-icons');

// TODO: DEMONSTRATE API
```
npm package: @nextjscms/translations
Description: Translation dictionaries for the nextjs-cms framework. Provides localized strings for the CMS admin interface.
Latest version: 0.9.9

# @nextjscms/translations

Translation dictionaries for the nextjs-cms framework. Provides localized strings for the CMS admin interface.

## Supported Languages

- English (`en`)
- Arabic (`ar`)

## Installation

```bash
pnpm add @nextjscms/translations
```

## Usage

```typescript
import en from '@nextjscms/translations/dictionaries/en'
import ar from '@nextjscms/translations/dictionaries/ar'
```

## License

MIT License - see [LICENSE](./LICENSE) for details.
npm package: @nextjspro/cookies
Description: Cookie management library for NextJS applicatons, with built in support for TypeScript
Author: nextjspro
Latest version: 1.0.0

# NextJsPro Cookie Management

This package provides a simple and TypeScript-friendly way to manage cookies in your Next.js application. It includes three functions for setting, getting, and removing cookies with various options.

## Installation

To install the package, run the following command:

```
npm install @nextjspro/cookies
```

or if you're using Yarn:

```
yarn add @nextjspro/cookies
```

## Usage

Import the desired functions from the package and use them in your Next.js application:

```typescript
import { setCookie, getCookie, removeCookie } from "@nextjspro/cookies";

// Set a cookie
setCookie("myCookie", "hello");

// Set a cookie with parameters
setCookie("myCookie", "hello", { expires: 7, path: "/" });

// Get the value of a cookie
const cookieValue = getCookie("myCookie"); // 'hello'

// Remove a cookie
removeCookie("myCookie", { path: "/" });
```

### setCookie

The `setCookie` function sets a cookie with the given name, value, and options.

```typescript
setCookie(name: string, value: string, options?: CookieOptions);
```

- `name` (string, required): The name of the cookie to set.
- `value` (string, required): The value of the cookie to set.
- `options` (CookieOptions, optional): Optional options for setting the cookie.

### getCookie

The `getCookie` function gets the value of the cookie with the given name.

```typescript
getCookie(name: string): string;
```

- `name` (string, required): The name of the cookie to get.
- Returns: The value of the cookie, or an empty string if the cookie is not found.

### removeCookie

The `removeCookie` function removes the cookie with the given name and options.

```typescript
removeCookie(name: string, options?: CookieOptions);
```

- `name` (string, required): The name of the cookie to remove.
- `options` (CookieOptions, optional): Optional options for removing the cookie.

## TypeScript Support

This package is written in TypeScript and includes type definitions for better tooling support and type safety.

## Development

To develop or build the package, follow these steps:

1. Clone the repository
2. Install dependencies: `npm install` or `yarn install`
3. Build the package: `npm run build` or `yarn build`
4. (Optional) Start the development server: `npm run dev` or `yarn dev`

The built package will be located in the `dist` directory.

## License

This package is licensed under the [MIT License](LICENSE).

## Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
npm package: @nextlevelcoder/defaultmap
Description: A map class that sets a default value when an unset key is requested.
Author: Joseph Cohen
Latest version: 0.0.6

# defaultmap
A map that sets a default value when an unset key is requested.

Just like a regular map, except you pass a default value to the constructor and that value is set whenever you try to get an unset key.

## Constructor

```js
const { DefaultMap } = require('@nextlevelcoder/DefaultMap');

let staticMap = new DefaultMap(7); // 7
console.log(staticMap.get(1)); // 7
console.log(staticMap.get({})); // 7
console.log(staticMap.get([])); // 7

let classMap = new DefaultMap(() => new SimpleState());
console.log(classMap.get('accountState')) // a new SimpleState instance
console.log(classMap.get('networkState')) // a new SimpleState instance

let dynamicMap = new DefaultMap((key) => key);
console.log(dynamicMap.get(1)); // 1
console.log(dynamicMap.get({})); // {}
console.log(dynamicMap.get([])); // []
```