open-index/open-npm huggingface dataset:
npm package: @juggling-tools/simulator
Description: Siteswap juggling pattern animator for the browser
Latest version: 1.1.0

# @juggling-tools/simulator

Browser-based siteswap juggling pattern animator. Pass a siteswap string and a canvas element, and it renders an animated stick-figure juggler throwing and catching balls along parabolic arcs. See it in action at [jugglingtools.com](https://jugglingtools.com).

## Installation

```bash
npm install @juggling-tools/simulator
```

## Quick start

```js
import { createSimulator } from "@juggling-tools/simulator";

const canvas = document.querySelector("canvas");
const sim = createSimulator(canvas, { siteswap: "531" });
sim.start();
```

## Options

```ts
createSimulator(canvas, {
  siteswap: "531", // required, base-36 siteswap string
  numHands: 2, // default: 2
  beatDuration: 360, // ms per beat (default: 360)
  dwellRatio: 0.6, // fraction of beat the ball stays in hand (0-1)
  arcPeakPosition: 0.55, // horizontal skew of throw arc peak (0-1)
  colors: ["red", "green", "blue"], // ball colors (cycles if fewer than balls)
  background: "#111111", // canvas background color
  showJuggler: true, // draw stick figure
  render: (ctx, w, h, frame) => {
    /* custom renderer */
  },
});
```

## Runtime control

The `createSimulator` call returns a `Simulator` handle:

```ts
sim.start();
sim.stop();
sim.setSiteswap("441");
sim.setNumHands(4);
sim.setBeatDuration(300);
sim.setDwellRatio(0.5);
sim.setArcPeakPosition(0.6);
sim.setColors(["#ff0000", "#00ff00"]);
sim.setBackground("#000");
sim.setShowJuggler(false);
sim.setRender(customFn); // or null to restore default
sim.resize(); // recalculate after canvas resize
```

Changes to `siteswap`, `numHands`, and `colors` rebuild the throw schedule and restart the animation. Everything else applies live.

## Custom rendering

Pass a `render` function to take full control of drawing. You receive pre-computed frame data:

```ts
type FrameData = {
  background: string;
  showJuggler: boolean;
  handPositions: Vec2[];
  balls: BallPosition[]; // { position: Vec2, color: string }
};
```

The default renderer's drawing primitives are also exported for mix-and-match use:

```ts
import { drawBall, drawHand, drawJuggler } from "@juggling-tools/simulator";
```

## Examples

For a full working example with vanilla JS, see [`demo.html`](./demo.html).

For a React integration with custom renderers (glow balls, spinning squares, custom juggler), see the [simulator demo page](https://github.com/calthejuggler/juggling-tools/blob/main/web/src/pages/simulator.tsx) in the main app, or check out [`@juggling-tools/simulator-react`](../react).

## License

MIT
npm package: @jugnuagrawal/express-mongoose-crud
Description: A node js library to generate a microservice capable of doing CRUD operation over REST API for the given schema structure.
Author: Jugnu Agrawal
Latest version: 1.0.1

# express-mongoose-crud

This tool to generate microservice based on express js and mongoose js which can do CRUD operation using REST APIs.


### Use like a node module

```sh
$ npm install --save express-mongoose-crud
```

- import express-mongoose-crud to your project and pass the schema json.

```javascript
const generator = require('express-mongoose-crud');

var schema = {
    "name": "User Details",
    "basePath": "/user",
    "port": 3000,
    "database": "users",
    "schema": {
        "name": "String",
        "email": {
            "type": "String",
            "unique": true,
            "required": true
        },
        "password": "String",
        "contactNos": [
            {
                "code": "String",
                "number": "Number"
            }
        ],
        "gender": "String",
        "address": {
            "houseNo": "String",
            "street": "String",
            "city": "String",
            "state": "String",
            "country": "String",
            "pincode": "Number"
        }
    }
}

generator.createProject(schema);

```


### Use with command line interface

```sh
$ npm install -g express-mongoose-crud

$ misgen -h

Usage: misgen [options] <name>

Options:

  -V, --version  output the version number
  -d, --dir      Directory name 
  -h, --help     output usage information


# [-d generates microservice for all the schema files in a directory
```

```sh

$ misgen schema.json

#The project folder will be generated at the location of schema.json file
```


### Schema JSON Structure

```javascript
{
    "name":"User Details", //Required. Name of this microservice
    "basePath":"/user", //Optional. API URL of this microservice
    "port":3000, //Optional. Port number in which this microservice will be running
    "database":"users", //Optional. Name of database in which this microservice will create it's collection
    "schema":{
        //mongoose schema
    }
}
```
- Example mongoose schema
```javascript
{
    "name": "String",
    "email": {
        "type": "String",
        "unique": true,
        "required": true
    },
    "password": "String",
    "contactNos": [
        {
            "code": "String",
            "number": "Number"
        }
    ],
    "gender": "String",
    "address": {
        "houseNo": "String",
        "street": "String",
        "city": "String",
        "state": "String",
        "country": "String",
        "pincode": "Number"
    }
}
```
- [More info on mongoose schema](http://mongoosejs.com/docs/guide.html)

<!--[API Documentation](https://github.com/jugnuagrawal/express-mongoose-crud/wiki)-->

License
----

MIT
npm package: @juguli/mcp
Description: A package containing files for the MCP project.
Latest version: 0.1.3

# @juguli/mcp - AI 图片生成工具

一个基于 ModelScope API 的 AI 图片生成工具，可以通过 npx 快速使用，特别适合在 Cursor IDE 中集成使用。

## 功能特点

- 🚀 **即开即用**: 通过 `npx` 命令一键运行，无需复杂配置
- 🎨 **AI 图片生成**: 基于 ModelScope 的 MAILAND/majicflus_v1 模型
- 📱 **手机壳产品图**: 专门优化用于生成手机壳产品展示图片
- 🔧 **Cursor 集成**: 完美集成到 Cursor IDE 工作流中
- 🌐 **跨平台**: 支持 Windows、macOS 和 Linux

## 快速开始

### 1. 直接使用

```bash
npx @juguli/mcp
```

### 2. 环境要求

在使用之前，请确保您的系统满足以下要求：

**安装 Python 3**
- 从 [Python 官网](https://www.python.org/downloads/) 下载并安装 Python 3
- 安装时请勾选 "Add Python to PATH" 选项

**安装 Python 依赖**
```bash
pip install requests pillow
```

## 在 Cursor IDE 中使用

### 方法一：通过终端集成

1. 在 Cursor 中打开集成终端 (`Ctrl+`` 或 `Cmd+``)
2. 运行命令：
   ```bash
   npx @juguli/mcp
   ```
3. 生成的图片将保存在当前工作目录中

### 方法二：创建自定义任务

在您的项目根目录创建 `.vscode/tasks.json` 文件：

```json
{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "生成产品图片",
            "type": "shell",
            "command": "npx",
            "args": ["@juguli/mcp"],
            "group": "build",
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": false,
                "panel": "shared"
            },
            "problemMatcher": []
        }
    ]
}
```

然后通过 `Ctrl+Shift+P` (或 `Cmd+Shift+P`) 打开命令面板，搜索 "Tasks: Run Task"，选择 "生成产品图片"。

### 方法三：配置为 MCP 服务器

如果您在 Cursor 中使用 Claude 等 AI 助手，可以将此工具配置为 MCP 服务器：

1. 在 Cursor 设置中添加 MCP 服务器配置
2. 服务器命令：`npx @juguli/mcp`
3. 这样 AI 助手就可以直接调用图片生成功能

### 方法四：快捷键绑定

在 Cursor 的 `keybindings.json` 中添加：

```json
{
    "key": "ctrl+shift+g",
    "command": "workbench.action.terminal.sendSequence",
    "args": {
        "text": "npx @juguli/mcp\n"
    }
}
```

现在您可以通过 `Ctrl+Shift+G` 快速生成图片。

## 工作原理

1. **命令执行**: 运行 `npx @juguli/mcp` 时，会下载并执行 `cli.js`
2. **Python 调用**: `cli.js` 会自动调用 `generate_image.py` 脚本
3. **API 请求**: Python 脚本向 ModelScope API 发送图片生成请求
4. **图片下载**: 下载生成的图片并保存为 `product_2.jpg`

## 自定义配置

### 修改生成提示词

如果您想修改生成的图片内容，可以：

1. 复制这个包到本地项目
2. 修改 `generate_image.py` 中的 `prompt` 字段
3. 本地运行 `python generate_image.py`

### API 密钥

当前使用的是演示 API 密钥。在生产环境中，建议：

1. 注册 [ModelScope](https://modelscope.cn/) 账号
2. 获取您自己的 API 密钥
3. 替换 `generate_image.py` 中的 `Authorization` 头部

## 故障排除

### Python 未找到
```
错误: 'python' 不是内部或外部命令
```
**解决方案**: 确保 Python 已安装并添加到系统 PATH 中

### 依赖库缺失
```
ModuleNotFoundError: No module named 'requests'
```
**解决方案**: 运行 `pip install requests pillow`

### 网络连接问题
```
SSL 错误或连接超时
```
**解决方案**: 检查网络连接，确保可以访问 ModelScope API

## 许可证

MIT License - 详见 [LICENSE](LICENSE) 文件

## 贡献

欢迎提交 Issue 和 Pull Request！

## 更新日志

### v0.1.2
- 初始发布
- 支持基本的图片生成功能
- 集成 Cursor IDE 使用说明

---

**需要帮助？** 请在 [GitHub Issues](https://github.com/juguli/mcp/issues) 中提出问题。