{"_id":"@about-me/fp","_rev":"5-44b8620a27f86983e17c806f5826e4f1","name":"@about-me/fp","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"@about-me/fp","version":"1.0.0","keywords":["fp","fp-ts","functional-programming","typescript","functional-utilities","functional-composition"],"author":{"name":"llong8"},"license":"MIT","_id":"@about-me/fp@1.0.0","maintainers":[{"name":"llongg","email":"1091852800@qq.com"}],"homepage":"https://github.com/llong8/fp#readme","bugs":{"url":"https://github.com/llong8/fp/issues"},"dist":{"shasum":"b87a83de9adf457356216a48e6b61c4dbd9abfd3","tarball":"https://registry.npmjs.org/@about-me/fp/-/fp-1.0.0.tgz","fileCount":28,"integrity":"sha512-hivc9qxfSs/C0D9dn5dZscM34+0dJbv9UvdgKXrl2hIGcq8nCjaEPmoS8DZ40VXMNe+Ph5sQjoFVAdvZq5hrRQ==","signatures":[{"sig":"MEYCIQCZJRTQS6OLZt7ymZnI3MbREGoltIbaiBOvN8cdG0A4AAIhAP8KNHX3xLx7ZK8sISUIilN4M48Su+G7V6YZ61I2+FiU","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":25199},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"0afca58a926ce405b88723fe4cca114f5bd17092","scripts":{"test":"vitest","build":"tsc --declaration false && tsup","clean":"rm -rf dist","test:ui":"vitest --ui","test:run":"vitest run","type-check":"tsc --noEmit","build:watch":"tsc --declaration false --watch","test:coverage":"vitest --coverage","prepublishOnly":"pnpm run clean && pnpm run test:run && pnpm run build"},"_npmUser":{"name":"llongg","email":"1091852800@qq.com"},"repository":{"url":"git+https://github.com/llong8/fp.git","type":"git"},"_npmVersion":"11.4.2","description":"函数式编程工具集","directories":{},"_nodeVersion":"24.3.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","vitest":"^2.0.0","@vitest/ui":"^2.0.0","typescript":"^5.3.3","@types/node":"^24.7.2"},"_npmOperationalInternal":{"tmp":"tmp/fp_1.0.0_1760530875656_0.7916350926778508","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@about-me/fp","version":"1.0.1","keywords":["fp","fp-ts","functional-programming","typescript","functional-utilities","functional-composition"],"author":{"name":"llong8"},"license":"MIT","_id":"@about-me/fp@1.0.1","maintainers":[{"name":"llongg","email":"1091852800@qq.com"}],"homepage":"https://github.com/llong8/fp#readme","bugs":{"url":"https://github.com/llong8/fp/issues"},"dist":{"shasum":"57ad3a93a40ec875dafbdf8e36041194e80d3699","tarball":"https://registry.npmjs.org/@about-me/fp/-/fp-1.0.1.tgz","fileCount":28,"integrity":"sha512-dBesyE2fl/sp2D1diWcavJZjFzIFq9AlWyMZKlFhrMpqeLjP8aIYwbKE2ebjA9e51DhXJ0lBCctNgH3j+mpDOg==","signatures":[{"sig":"MEUCIQDQZgL3ev4/kl8yzljsNJaez/GJ2Vznu8U0laA369RN3gIgVCR+WOedbCrz2mm8VuDdjBFhJS/a3HEVGnu0gMopi3s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26320},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"2c177c17888ebaa419e7d22e5b54ac440a197048","scripts":{"test":"vitest","build":"tsc --declaration false && tsup","clean":"rm -rf dist","test:ui":"vitest --ui","test:run":"vitest run","type-check":"tsc --noEmit","build:watch":"tsc --declaration false --watch","test:coverage":"vitest --coverage","prepublishOnly":"pnpm run clean && pnpm run test:run && pnpm run build"},"_npmUser":{"name":"llongg","email":"1091852800@qq.com"},"repository":{"url":"git+https://github.com/llong8/fp.git","type":"git"},"_npmVersion":"11.4.2","description":"函数式编程工具集","directories":{},"_nodeVersion":"24.3.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","vitest":"^2.0.0","@vitest/ui":"^2.0.0","typescript":"^5.3.3","@types/node":"^24.7.2"},"_npmOperationalInternal":{"tmp":"tmp/fp_1.0.1_1760551708376_0.21349196821706795","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@about-me/fp","version":"1.0.2","keywords":["fp","fp-ts","functional-programming","typescript","functional-utilities","functional-composition"],"author":{"name":"llong8"},"license":"MIT","_id":"@about-me/fp@1.0.2","maintainers":[{"name":"llongg","email":"1091852800@qq.com"}],"homepage":"https://github.com/llong8/fp#readme","bugs":{"url":"https://github.com/llong8/fp/issues"},"dist":{"shasum":"c90734f7d70e2bf6079c47b8c2a2f62b4e96b525","tarball":"https://registry.npmjs.org/@about-me/fp/-/fp-1.0.2.tgz","fileCount":26,"integrity":"sha512-s8gyfs6ft0fGZIdDe5sEUJ2Q+nrzssdZ8axH23nDlic8wQhXvFa+5SH1kfVCJAhmurcsZ5BojmcuA/sPJyTqiQ==","signatures":[{"sig":"MEUCIGQr9iGceZxLi2ZSTBlu1OWXAapVGjoEIAALWOx4E9fzAiEAvrZgutqcPWiTO3ppE67AtD3NYFmdQrIc12eqAc/89Cw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34140},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"f3cb11be3e650c69db9eb8791b613cc04c2702b0","scripts":{"test":"vitest","build":"tsc --declaration false && tsup","clean":"rm -rf dist","test:ui":"vitest --ui","test:run":"vitest run","type-check":"tsc --noEmit","build:watch":"tsc --declaration false --watch","test:coverage":"vitest --coverage","prepublishOnly":"pnpm run clean && pnpm run test:run && pnpm run build"},"_npmUser":{"name":"llongg","email":"1091852800@qq.com"},"repository":{"url":"git+https://github.com/llong8/fp.git","type":"git"},"_npmVersion":"11.4.2","description":"函数式编程工具集","directories":{},"_nodeVersion":"24.3.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","vitest":"^2.0.0","@vitest/ui":"^2.0.0","typescript":"^5.3.3","@types/node":"^24.7.2"},"_npmOperationalInternal":{"tmp":"tmp/fp_1.0.2_1760635663100_0.668653277061281","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@about-me/fp","version":"1.0.3","keywords":["fp","fp-ts","functional-programming","typescript","functional-utilities","functional-composition"],"author":{"name":"llong8"},"license":"MIT","_id":"@about-me/fp@1.0.3","maintainers":[{"name":"llongg","email":"1091852800@qq.com"}],"homepage":"https://github.com/llong8/fp#readme","bugs":{"url":"https://github.com/llong8/fp/issues"},"dist":{"shasum":"82fc57f18653df3facc4e7c6624f1c89d5716eb1","tarball":"https://registry.npmjs.org/@about-me/fp/-/fp-1.0.3.tgz","fileCount":26,"integrity":"sha512-KuW0o9G9/SQefFYO9pEH5qspTkXruglpDAFiizexr/HWyPQhkqHpv81hB/bDMtZgvBJOrB5IinKuF0jsB2iifw==","signatures":[{"sig":"MEUCIBT9T+Sv4lIgq2dBnh5TPsnH5j9Gf9RhXX9w1RVFmVzjAiEAvIPNtmKuSnrhDh/nTN1tg512oer31k6CfEOs6lKDAqc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":35163},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"e6aa837cb9c52844397d8aa842f6e575d752da26","scripts":{"test":"vitest","build":"tsc --declaration false && tsup","clean":"rm -rf dist","test:ui":"vitest --ui","test:run":"vitest run","type-check":"tsc --noEmit","build:watch":"tsc --declaration false --watch","test:coverage":"vitest --coverage","prepublishOnly":"pnpm run clean && pnpm run test:run && pnpm run build"},"_npmUser":{"name":"llongg","email":"1091852800@qq.com"},"repository":{"url":"git+https://github.com/llong8/fp.git","type":"git"},"_npmVersion":"11.4.2","description":"函数式编程工具集","directories":{},"_nodeVersion":"24.3.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","vitest":"^2.0.0","@vitest/ui":"^2.0.0","typescript":"^5.3.3","@types/node":"^24.7.2"},"_npmOperationalInternal":{"tmp":"tmp/fp_1.0.3_1760643333083_0.06259940544583298","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@about-me/fp","version":"1.0.4","description":"函数式编程工具集","main":"dist/index.js","module":"dist/index.js","types":"dist/index.d.ts","type":"module","keywords":["fp","fp-ts","functional-programming"],"author":{"name":"llong8"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/llong8/fp.git"},"exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"devDependencies":{"@types/node":"^24.7.2","@vitest/ui":"^2.0.0","tsup":"^8.5.0","typescript":"^5.3.3","vitest":"^2.0.0"},"engines":{"node":">=18.0.0"},"publishConfig":{"access":"public"},"scripts":{"build":"tsup","build:watch":"tsc --declaration false --watch","clean":"rm -rf dist","test":"vitest","test:ui":"vitest --ui","test:coverage":"vitest --coverage","test:run":"vitest run","type-check":"tsc --noEmit","format":"prettier --write ."},"_id":"@about-me/fp@1.0.4","bugs":{"url":"https://github.com/llong8/fp/issues"},"homepage":"https://github.com/llong8/fp#readme","_integrity":"sha512-TrgLQLR/MdV4LiTvcotbxeGmEvTCkf4YSmg31HiMjqiKJNROmH6LWpVynvW7y8uK6LlDFWjuNZT/uN1tiwuwgw==","_resolved":"C:\\Users\\xiaol\\AppData\\Local\\Temp\\1d4dde4e0a8b5de6fba04e5155c5ac91\\about-me-fp-1.0.4.tgz","_from":"file:about-me-fp-1.0.4.tgz","_nodeVersion":"23.11.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-TrgLQLR/MdV4LiTvcotbxeGmEvTCkf4YSmg31HiMjqiKJNROmH6LWpVynvW7y8uK6LlDFWjuNZT/uN1tiwuwgw==","shasum":"4376d24da20dc68d68ee54e40e47a6010a6f3bd5","tarball":"https://registry.npmjs.org/@about-me/fp/-/fp-1.0.4.tgz","fileCount":5,"unpackedSize":22842,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDWump7QnoaC9fMolBMfqF6OFdcyM6fAqWK6PaMazOMaAiAef2bdnTst+6leywq4fqOzcTIaV9v/DtnlfJq1U5frUA=="}]},"_npmUser":{"name":"llongg","email":"1091852800@qq.com"},"directories":{},"maintainers":[{"name":"llongg","email":"1091852800@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/fp_1.0.4_1764347623289_0.8205844199660257"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-15T12:21:15.540Z","modified":"2025-11-28T16:33:43.719Z","1.0.0":"2025-10-15T12:21:15.823Z","1.0.1":"2025-10-15T18:08:28.575Z","1.0.2":"2025-10-16T17:27:43.282Z","1.0.3":"2025-10-16T19:35:33.274Z","1.0.4":"2025-11-28T16:33:43.490Z"},"bugs":{"url":"https://github.com/llong8/fp/issues"},"author":{"name":"llong8"},"license":"MIT","homepage":"https://github.com/llong8/fp#readme","keywords":["fp","fp-ts","functional-programming"],"repository":{"type":"git","url":"git+https://github.com/llong8/fp.git"},"description":"函数式编程工具集","maintainers":[{"name":"llongg","email":"1091852800@qq.com"}],"readme":"# @about-me/fp\r\n\r\n<div align=\"center\">\r\n\r\n**轻量级 TypeScript 函数式编程工具库**\r\n\r\n[![npm version](https://img.shields.io/npm/v/@about-me/fp.svg)](https://www.npmjs.com/package/@about-me/fp)\r\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.3-blue.svg)](https://www.typescriptlang.org/)\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\r\n[![Bundle Size](https://img.shields.io/badge/gzipped-~2KB-green.svg)](https://bundlephobia.com/)\r\n[![Tests](https://img.shields.io/badge/tests-97%20passing-brightgreen.svg)](./test)\r\n\r\n提供 `pipe`、`compose`、`curry` 等 11 个核心函数式编程工具\r\n\r\n[快速开始](#快速开始) · [API 参考](#api-参考) · [完整文档](https://github.com/llong8/fp/tree/main/docs) · [LLMS-txt](#llm-辅助编程文档)\r\n</div>\r\n\r\n---\r\n\r\n\r\n## 安装\r\n\r\n```bash\r\nnpm install @about-me/fp\r\n# 或\r\npnpm add @about-me/fp\r\n```\r\n\r\n## 快速开始\r\n\r\n```typescript\r\nimport { pipe, curry, tap, debounce } from '@about-me/fp'\r\n\r\n// 1. 使用 pipe 创建数据处理管道\r\nconst result = pipe(\r\n  [1, 2, 3, 4, 5],\r\n  arr => arr.map(x => x * 2),\r\n  tap(x => console.log('Doubled:', x)),  // 调试不影响数据流\r\n  arr => arr.filter(x => x > 5),\r\n  arr => arr.reduce((sum, x) => sum + x, 0)\r\n)\r\n// 输出: 24\r\n\r\n// 2. 使用 curry 创建专用函数\r\nconst filterBy = curry((prop, value, arr) =>\r\n  arr.filter(item => item[prop] === value)\r\n)\r\n\r\nconst users = [\r\n  { name: 'Alice', role: 'admin' },\r\n  { name: 'Bob', role: 'user' }\r\n]\r\n\r\nconst getAdmins = filterBy('role')('admin')\r\ngetAdmins(users)  // [{ name: 'Alice', role: 'admin' }]\r\n\r\n// 3. 使用 debounce 优化搜索\r\nconst searchAPI = debounce((query: string) => {\r\n  fetch(`/api/search?q=${query}`)\r\n}, 300)\r\n\r\ninput.addEventListener('input', e => searchAPI(e.target.value))\r\n// 输入停止 300ms 后才发送请求\r\n```\r\n\r\n## 文档\r\n\r\n完整的 API 参考文档请访问 [GitHub 文档](https://github.com/llong8/fp/tree/main/docs) \r\n\r\n## API 参考\r\n\r\n### 核心组合函数\r\n\r\n| 函数 | 描述 | 使用场景 |\r\n|------|------|---------|\r\n| **[pipe](https://github.com/llong8/fp/blob/main/docs/pipe.md)** | 从左到右组合函数，支持同步和异步 | 数据转换管道、流程编排、异步操作 |\r\n| **[compose](https://github.com/llong8/fp/blob/main/docs/compose.md)** | 从右到左组合函数 | 数学风格组合、高阶函数 |\r\n\r\n### 函数转换\r\n\r\n| 函数 | 描述 | 使用场景 |\r\n|------|------|---------|\r\n| **[curry](https://github.com/llong8/fp/blob/main/docs/curry.md)** | 柯里化 | 创建专用函数、参数复用 |\r\n| **[partial](https://github.com/llong8/fp/blob/main/docs/partial.md)** | 部分应用 | 固定部分参数 |\r\n\r\n### 副作用和调试\r\n\r\n| 函数 | 描述 | 使用场景 |\r\n|------|------|---------|\r\n| **[tap](https://github.com/llong8/fp/blob/main/docs/tap.md)** | 执行副作用但不改变值，支持同步和异步 | 调试、日志、监控、异步日志 |\r\n\r\n### 基础工具\r\n\r\n| 函数 | 描述 | 使用场景 |\r\n|------|------|---------|\r\n| **[identity](https://github.com/llong8/fp/blob/main/docs/identity.md)** | 返回输入值本身 | 过滤假值、默认函数、类型保护 |\r\n| **[constant](https://github.com/llong8/fp/blob/main/docs/constant.md)** | 返回常量函数 | 默认值、数组填充、事件处理 |\r\n\r\n### 性能优化\r\n\r\n| 函数 | 描述 | 使用场景 |\r\n|------|------|---------|\r\n| **[memoize](https://github.com/llong8/fp/blob/main/docs/memoize.md)** | 缓存函数结果 | 昂贵计算、递归优化 |\r\n| **[debounce](https://github.com/llong8/fp/blob/main/docs/debounce.md)** | 防抖 | 搜索输入、自动保存 |\r\n| **[throttle](https://github.com/llong8/fp/blob/main/docs/throttle.md)** | 节流 | 滚动事件、鼠标移动 |\r\n\r\n## LLM 辅助编程文档\r\n\r\n以下是 txt 格式的文档文件列表，包括 `llms.txt` 和 `llms-full.txt`。这些文件供大型语言模型（LLM）访问本库的编程文档及 API。\r\n\r\n| 文件类型 | 链接 | 说明 |\r\n|---------|------|------|\r\n| **llms.txt** | https://github.com/llong8/fp/blob/main/llms/llms.txt | 索引文件，包含 API 列表和简短描述 |\r\n| **llms-full.txt** | https://github.com/llong8/fp/blob/main/llms/llms-full.txt | 完整文档，包含详细说明和代码示例 |\r\n\r\n### 使用方式\r\n\r\n在 AI 编程助手（Claude、Copilot、Cursor 等）中引用文档：\r\n\r\n```\r\n@llms/llms.txt\r\n\r\n请帮我使用 `@about-me/fp` 创建一个数据处理管道：\r\n1. 过滤活跃用户\r\n2. 按评分排序\r\n3. 添加元数据\r\n4. 在每一步记录日志\r\n```\r\n\r\n\r\n### llms.txt 和 llms-full.txt 的区别\r\n\r\n- **llms.txt**：索引文件，包含 API 链接和简要描述，LLM 需点击链接获取详细内容\r\n- **llms-full.txt**：完整文档，所有内容在单个文件中，无需额外访问\r\n\r\n注意：`llms-full.txt` 文件较大，可能超出部分 LLM 的上下文窗口限制。\r\n\r\n\r\n---\r\n\r\n","readmeFilename":"README.md"}