open-index/open-npm huggingface dataset:
npm package: @michaelganchas/ts-inject
Description: A lightweight TypeScript dependency injection library
Author: Michael Ganchas
Latest version: 1.0.3

# ts-inject

[![npm version](https://img.shields.io/npm/v/@michaelganchas/ts-inject.svg?style=flat)](https://www.npmjs.com/package/@michaelganchas/ts-inject)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)

**A lightweight, type-safe dependency injection library for TypeScript.**

`ts-inject` simplifies dependency management in TypeScript applications by providing a straightforward and efficient way to inject dependencies, enhancing modularity and testability.

## ✨ Features

- **Type-Safe**: Leverages TypeScript's type system for compile-time safety.
- **Lightweight**: Minimal overhead with a focus on simplicity.
- **Flexible**: Supports various injection patterns to suit different needs.
- **Test-Friendly**: Facilitates easy mocking and testing of dependencies.

## 📦 Installation

```bash
npm install @michaelganchas/ts-inject
# or
yarn add @michaelganchas/ts-inject
```

## 📌 Where to Use

You can use `ts-inject` in any **TypeScript-based project** where clean architecture, testability, and modularity matter. Some common use cases include:

- **Modular backend applications** (e.g. Node.js with Express or Koa)
- **Domain-driven design (DDD)** implementations
- **Microservices** and **serverless functions**
- **CLIs and tooling** built with TypeScript
- **Unit testing** with easily mockable dependencies
- **Frontend apps** (e.g. React, React Native or Vue with TypeScript) that follow service-based architecture

> If you're tired of manually wiring dependencies or passing instances all over your codebase, `ts-inject` offers a clean, intuitive alternative.

## 🔍 Examples

- Using the container to register and obtain dependencies:
    - First we define our implementation
    ```
    [src/services/events/eventsService.ts]
    
    const send = () => {...}

    export const eventsService = {
        send,
    };

    export type EventsService = typeof eventsService;
    ```
    - Then, we set up a key for that implementation
    ```
    [src/services/events/types.ts]
    
    export const EventsServiceKey: PropertyKey = 'EVENTS_SERVICE';
    ```
    - We hook everything up together
    ```
    [src/services/events/index.ts]
    
    container.register<EventsService>(EventsServiceKey, () => eventsService);
    ```
    - Then we're just missing two things:
        - A place to import/load all the registrations
        ```
        [src/core/di/diSetup.ts]
        
        import '/src/services/events/index';
        ...
        ```
        - And lastly, to run it in our App's entry point as one of the first imports
        ```
        [src/index.ts]
        
        import 'src/core/di/diSetup';
        ...
        ```

- Auto wire dependencies automatically:
    - Check the `examples/` folder for how to use for either Class injections, or functional ones.


## 📚 API Reference

Check the `types.ts` file under `src/` as it contains all the explanations inside their definitions.
npm package: @michaelguo/math-mcp-server-nodejs
Description: A NodeJS MCP Server that provides mathematical operations
Author: Michael Guo
Latest version: 1.0.5

# Math MCP Server (NodeJS)

[![npm version](https://badge.fury.io/js/@michaelguo91%2Fmath-mcp-server-nodejs.svg)](https://badge.fury.io/js/@michaelguo91%2Fmath-mcp-server-nodejs)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

一个基于 NodeJS 的 Model Context Protocol (MCP) 服务器，提供数学计算功能。

## 功能特性

- **加法工具**: 提供两个数字的加法计算
- **服务器信息资源**: 展示服务器的基本信息
- **计算提示模板**: 用于数学计算的提示模板

## 安装

### 从 npm 安装（推荐）

```bash
npm install -g @michaelguo91/math-mcp-server-nodejs
```

### 从源码安装

1. 克隆或下载项目到本地
2. 安装依赖：

```bash
npm install
```

## 构建

```bash
npm run build
```

## 运行

### 开发模式
```bash
npm run dev
```

### 生产模式
```bash
npm start
```

### 监听模式（自动重新编译）
```bash
npm run watch
```

## 使用方法

这个 MCP 服务器通过 stdio 传输层与客户端通信。它提供以下功能：

### 工具 (Tools)

#### `add`
计算两个数字的和。

**参数:**
- `a` (number): 第一个数字
- `b` (number): 第二个数字

**示例:**
```json
{
  "name": "add",
  "arguments": {
    "a": 5,
    "b": 3
  }
}
```

**返回:**
```json
{
  "content": [
    {
      "type": "text",
      "text": "计算结果: 5 + 3 = 8"
    }
  ]
}
```

### 资源 (Resources)

#### `server-info`
获取服务器的基本信息。

**URI:** `info://server`

### 提示 (Prompts)

#### `calculate`
用于数学计算的提示模板。

**参数:**
- `operation` (string): 要执行的数学操作
- `numbers` (array): 参与计算的数字数组

## 与 MCP 客户端集成

### 全局安装后使用

如果你全局安装了这个包，可以直接使用命令：

```json
{
  "mcpServers": {
    "math-server": {
      "command": "math-mcp-server"
    }
  }
}
```

### 本地安装使用

要在 MCP 客户端中使用此服务器，请将以下配置添加到客户端的配置文件中：

```json
{
  "mcpServers": {
    "math-server": {
      "command": "node",
      "args": ["path/to/math-mcp-server-nodejs/dist/index.js"]
    }
  }
}
```

### 使用 npx（无需安装）

```json
{
  "mcpServers": {
    "math-server": {
      "command": "npx",
      "args": ["@michaelguo91/math-mcp-server-nodejs"]
    }
  }
}
```

## 测试

你可以使用 [MCP Inspector](https://github.com/modelcontextprotocol/inspector) 来测试这个服务器：

```bash
npx @modelcontextprotocol/inspector node dist/index.js
```

## 项目结构

```
math-mcp-server-nodejs/
├── src/
│   └── index.ts          # 主服务器文件
├── dist/                 # 编译后的 JavaScript 文件
├── package.json          # 项目配置和依赖
├── tsconfig.json         # TypeScript 配置
└── README.md            # 项目说明
```

## 技术栈

- **NodeJS**: JavaScript 运行时
- **TypeScript**: 类型安全的 JavaScript
- **MCP SDK**: Model Context Protocol TypeScript SDK
- **Zod**: 运行时类型验证

## 许可证

MIT License

## 贡献

欢迎提交 Issue 和 Pull Request！

## 扩展功能

你可以轻松扩展这个服务器来添加更多数学功能：

- 减法、乘法、除法
- 高级数学函数（三角函数、对数等）
- 统计计算
- 矩阵运算

只需在 `src/index.ts` 中添加新的工具定义即可。
npm package: @michaelhelvey/beano
Description: the simplest imaginable logger
Author: Michael Helvey
Latest version: 1.0.3

# beano

An extremely simple synchronous logger. Useful for things like AWS lambda functions where you want a simple wrapper
around `console.log` but don't want to bundle large dependencies.

## Getting Started

```shell
<npm|yarn|pnpm|bun> install @michaelhelvey/beano
```

## Usage

### (Optional) Setup

Initialize logger with custom defaults. OpenTelemetry support is automatic if available.

```typescript
import { jsonFormatter, setup, textFormatter } from "@michaelhelvey/beano";

// Use defaults (text in dev, JSON in prod, debug level)
await setup();

// Or customize
await setup({
  level: "warn",
  formatter: jsonFormatter,
  writer: process.stderr.write.bind(process.stderr),
  annotater: () => ({ env: "prod" }),
});
```

**Note: you do not need to call `setup` at all in your code, unless you want to customize the defaults**.

### Formatters

**textFormatter** - Human-readable with timestamps. Default in development.

```
[2026-01-09T12:34:56.789Z]: INFO (my-module): message here
```

**jsonFormatter** - Structured JSON. Default in production.

```json
{ "ts": "2026-01-09T12:34:56.789Z", "mod": "my-module", "level": "info", "arg0": "message here" }
```

### Calling Loggers

Create a logger per module. Call directly for `info` level, or use level methods.

```typescript
import { getLogger } from "@michaelhelvey/beano";

const logger = getLogger("my-module");

// Info level (direct call)
logger("user logged in");

// Level methods
logger.trace("detailed trace");
logger.debug("debug details");
logger.info("info message");
logger.warn("warning");
logger.error("something failed", { code: 500 });
logger.fatal("fatal error");

// Pass objects as additional context
logger.error("request failed", { userId: 123, status: 500 });
```

Logs below configured level become no-ops for zero overhead.
npm package: @michaelhelvey/vite-config
Description: sane defaults for vite+
Latest version: 1.0.2

# @michaelhelvey/vite-config

Opinionated defaults for [Vite+](https://viteplus.dev/).

## Install

```sh
npm install -D @michaelhelvey/vite-config vite-plus
```

## Usage

In your `vite.config.ts`:

```ts
import { defineConfig } from "vite-plus";
import defaults from "@michaelhelvey/vite-config";

export default defineConfig({
  ...defaults,
  // override anything you need
});
```

## Customization

### Extending the default config

Spread the defaults and override individual sections:

```ts
import { defineConfig } from "vite-plus";
import defaults from "@michaelhelvey/vite-config";

export default defineConfig({
  ...defaults,
  test: {
    ...defaults.test,
    passWithNoTests: false,
  },
});
```

### Using lint presets directly

You can import the rule and plugin helpers to build your own lint config:

```ts
import { rulesForCategory, pluginsForCategory } from "@michaelhelvey/vite-config";

// Get all rules for a preset as { "scope/rule-name": "error" }
const rules = rulesForCategory("production_react");

// Get the plugin list for a preset
const plugins = pluginsForCategory("test");
```

### Accessing the raw rule data

The full scraped oxlint rule table is available as a separate export:

```ts
import { RULES } from "@michaelhelvey/vite-config/rules";
```

Each entry includes `scope`, `value`, `category`, `type_aware`, `fix`, `default`, and `docs_url`.

## Updating rules

The rule table in `src/rules.ts` is auto-generated from the
[oxc rules page](https://oxc.rs/docs/guide/usage/linter/rules.html). To refresh it:

```sh
npm run build:generate   # runs scripts/scrape-rules.ts
```

## License

MIT