open-index/open-npm huggingface dataset:
npm package: @musicmedia/next-git-version
Description: A Next.js component for displaying git version information
Author: MusicMedia
Latest version: 1.0.0

# @musicmedia/next-git-version

A Next.js component for displaying git version information in your application.

## Features

- Shows git branch and commit information
- Real-time updates for uncommitted changes in development
- Links to GitHub repository
- Configurable display options
- Works in both development and production environments
- Supports Heroku deployments

## Installation

```bash
npm install @musicmedia/next-git-version
```

## Setup

1. Add the build script to your package.json:

```json
{
  "scripts": {
    "build": "node node_modules/@musicmedia/next-git-version/dist/scripts/set-git-env.js && next build"
  }
}
```

2. Create an API route at `app/api/git-info/route.ts`:

```typescript
import { NextResponse } from 'next/server'
import { getGitInfo } from '@musicmedia/next-git-version'
import { headers } from 'next/headers'

export const runtime = 'nodejs'
export const dynamic = 'force-dynamic'

export async function GET() {
  const headersList = headers()
  const accept = headersList.get('accept')

  if (accept === 'text/event-stream') {
    const encoder = new TextEncoder()
    let closed = false

    const stream = new ReadableStream({
      start: async (controller) => {
        while (!closed) {
          try {
            const gitInfo = await getGitInfo()
            const data = encoder.encode(`data: ${JSON.stringify(gitInfo)}\n\n`)
            controller.enqueue(data)
            await new Promise(resolve => setTimeout(resolve, 2000))
          } catch (error) {
            console.error('Error in SSE stream:', error)
            controller.close()
            closed = true
            break
          }
        }
      },
      cancel() {
        closed = true
      }
    })

    return new Response(stream, {
      headers: {
        'Content-Type': 'text/event-stream',
        'Cache-Control': 'no-cache',
        'Connection': 'keep-alive'
      }
    })
  }

  const gitInfo = await getGitInfo()
  return NextResponse.json(gitInfo)
}
```

## Usage

```tsx
import { GitVersion } from '@musicmedia/next-git-version'

export function Footer() {
  return (
    <footer>
      <GitVersion 
        repoUrl="https://github.com/your-org/your-repo"
        className="text-sm text-gray-500"
        label="Version: "
        showBranch={true}
      />
    </footer>
  )
}
```

## Props

- `repoUrl` (required): Your GitHub repository URL
- `className`: Custom CSS class for the container
- `showBranch`: Whether to show the branch name (defaults to showing only in development)
- `label`: Custom label before the version info (defaults to "Version: ")

## Environment Variables

For Heroku deployments, set:
- `HEROKU_HOSTED=true`
- `HEROKU_BRANCH` (optional, defaults to 'main')
- `SOURCE_VERSION` (set automatically by Heroku)

## License

MIT
npm package: @musicode/egg-rate-limiter
Description: 限制接口调用次数
Latest version: 0.0.4

# egg-rate-limiter

限制接口调用次数

依赖 `egg-redis`

## Install

```bash
$ npm i egg-rate-limiter --save
```

## Usage

```js
// {app_root}/config/plugin.js
exports.rateLimiter = {
  enable: true,
  package: '@musicode/egg-rate-limiter',
};
```

## Configuration

```js
// {app_root}/config/config.default.js
exports.middleware = [
  'rateLimiter',
]
exports.rateLimiter = {
  onError: function (ctx, app) {
    // 超过上限时触发
    // 也可不配此回调，默认会返回 429 状态码
  },
  routers: {
    '/a/b': {
      // 举个例子，1 分钟最多调 10 次
      max: 10,
      duration: 60 * 1000
    }
  }
};
```

`app/extend/context` 对象需自行扩展一个 `getter`，如下：

module.exports = {

  get rateLimiterId() {
    return '可以是用户 id、ip 或别的'
  }

}

## License

[MIT](LICENSE)
npm package: @musicode/pattern-parser
Description: pattern parser
Author: musicode
Latest version: 0.0.3

# pattern-parser

解析常用正则

```js

import * as patternParser from 'pattern-parser'

patternParser.isEmail(str)
patternParser.isUrl(str)
patternParser.isTel(str)

patternParser.parse(str, pattern, title)

patternParser.parseAll(str)

```
npm package: @musicorum/lastfm
Description: Fully typed [Last.fm](https://last.fm) api client library written and made for Typescript!
Author: Musicorum Team
Latest version: 0.4.0

# @musicorum/lastfm

Fully typed [Last.fm](https://last.fm) api client library written and made for Typescript!

> **Warning**
> This library is still in alpha and on heavy development. Expect incomplete stuff and future changes.

## Basic usage

```ts
import { LastClient } from '@musicorum/lastfm'

const client = new LastClient('e8077692fe0485f6b474fdab331793c')

async function main() {
  // Original response from API (with types)
  const user1 = await client.request('user.getInfo', { user: 'metye' })

  // Formated response for better experience
  const user2 = await client.user.getInfo('metye')

  console.log(
    user1.user.playcount,
    user2.playCount
  )

  // Pagination
  const recentTracks = await client.user.getRecentTracksPaginated('metye')
  console.log(`${recentTracks.totalResults} results in ${recentTracks.totalPages} pages`)

  const page1 = recentTracks.getPage(1)
  const page2 = await recentTracks.fetchPage(2)

  console.log('Last scrobble:', page1[0].name, page1[0].nowPlaying ? ' - Now playing' : '')
}
main()
```
npm package: @musicorum/quadro
Description: Helper library for both NodeJS and web canvas
Author: Matheus Dias
Latest version: 2.0.1

<center>
  <img src="https://i.imgur.com/gb2AXqk.png"/>
  
  <h1 align="center">Quadro</h1>
  <p align="center">
    Helper library for both <a href="https://www.npmjs.com/package/canvas">node</a> and web canvas
  </p>
</center>

> ⚠️ **Warning**
>
> This project is still in early development. It should not be used yet.

> ⚠️ **Warning**
> 
> Starting from version `2.0.0`, this library is no longer compatible with `node-canvas`, now using `@napi-rs/canvas`.
> If you need to use it with `node-canvas`, please use version `1.1.3`.

## Installing

To install the package via npm, run:
```
npm i @musicorum/quadro
```