{"_id":"@aigne/typedoc-plugin-example-utils-ts","_rev":"5-bd284fc386713b875bf93682c6cb21cc","name":"@aigne/typedoc-plugin-example-utils-ts","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@aigne/typedoc-plugin-example-utils-ts","version":"1.0.0","keywords":[],"author":{"name":"Yechao Li","email":"liyechao@yechao.xyz"},"license":"MIT","_id":"@aigne/typedoc-plugin-example-utils-ts@1.0.0","maintainers":[{"name":"li-yechao","email":"liyechao@yechao.xyz"},{"name":"wangshijun","email":"shijun@arcblock.io"}],"dist":{"shasum":"2f28f14524799e060e734e17d626aac2a8451974","tarball":"https://registry.npmjs.org/@aigne/typedoc-plugin-example-utils-ts/-/typedoc-plugin-example-utils-ts-1.0.0.tgz","fileCount":8,"integrity":"sha512-2lN1+swJGPyWYARVoR/wLwXmFUIBZgLtu7YsbMOCktzNf5Dz0TpNXKiDoRvSinplhCCP2A3mmiYiRxYrMi6zCQ==","signatures":[{"sig":"MEUCIQDCBxPW5M4BHrRpMa3FczXoiFk0Wz05UCn5tlpHi0pY+AIgXH28qyPjc95B2C/Zx/U7qa6b071kWsf2HDb/EN9tFUQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8602},"main":"dist/index.js","_from":"file:aigne-typedoc-plugin-example-utils-ts-1.0.0.tgz","types":"./dist/index.d.ts","gitHead":"d58c314c751906e3f12aede636d6f811b1f8b76b","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc"},"_npmUser":{"name":"li-yechao","email":"liyechao@yechao.xyz"},"_resolved":"/private/var/folders/tp/46k4cvdn6mv9rzqgy8br5b9r0000gn/T/d2dcfa5bed6e47d2f9f95cc1e0678fa9/aigne-typedoc-plugin-example-utils-ts-1.0.0.tgz","_integrity":"sha512-2lN1+swJGPyWYARVoR/wLwXmFUIBZgLtu7YsbMOCktzNf5Dz0TpNXKiDoRvSinplhCCP2A3mmiYiRxYrMi6zCQ==","_npmVersion":"10.9.2","description":"A utils library for typedoc to process example codes","directories":{},"_nodeVersion":"23.11.0","dependencies":{"zod":"^3.24.3","typedoc":"^0.28.3","typescript":"^5.8.3"},"_hasShrinkwrap":false,"devDependencies":{"@biomejs/biome":"^1.9.4"},"_npmOperationalInternal":{"tmp":"tmp/typedoc-plugin-example-utils-ts_1.0.0_1745890570232_0.6631895362731146","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@aigne/typedoc-plugin-example-utils-ts","version":"1.0.1","keywords":[],"author":{"name":"Yechao Li","email":"liyechao@yechao.xyz"},"license":"MIT","_id":"@aigne/typedoc-plugin-example-utils-ts@1.0.1","maintainers":[{"name":"li-yechao","email":"liyechao@yechao.xyz"},{"name":"wangshijun","email":"shijun@arcblock.io"}],"dist":{"shasum":"e4839fe192b5184f85d99b2a69baaed9590bb0bb","tarball":"https://registry.npmjs.org/@aigne/typedoc-plugin-example-utils-ts/-/typedoc-plugin-example-utils-ts-1.0.1.tgz","fileCount":8,"integrity":"sha512-5kwegjGQgGdx0i5+SfYM80kgqeyFo2SWmUcabVzeOqE2hq/1jqwiJ4si/b5hUyptH4kwYjv3+3w1q6mCrUN98A==","signatures":[{"sig":"MEUCIQDH6g0lvRj4ZMH0nePuFF7uYNPIfBHMwB6BTUKy77NGcQIgBlk29hs/BVToaYL50oTi58ke48NdN3D4ke7nbEGtmsc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8958},"main":"dist/index.js","type":"module","_from":"file:aigne-typedoc-plugin-example-utils-ts-1.0.1.tgz","types":"./dist/index.d.ts","gitHead":"d58c314c751906e3f12aede636d6f811b1f8b76b","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","prepublish":"npm run build"},"_npmUser":{"name":"li-yechao","email":"liyechao@yechao.xyz"},"_resolved":"/private/var/folders/tp/46k4cvdn6mv9rzqgy8br5b9r0000gn/T/0544c39106654506524d5177f3da5ad4/aigne-typedoc-plugin-example-utils-ts-1.0.1.tgz","_integrity":"sha512-5kwegjGQgGdx0i5+SfYM80kgqeyFo2SWmUcabVzeOqE2hq/1jqwiJ4si/b5hUyptH4kwYjv3+3w1q6mCrUN98A==","_npmVersion":"10.9.2","description":"A utils library for typedoc to process example codes","directories":{},"_nodeVersion":"23.11.0","dependencies":{"zod":"^3.24.3","typedoc":"^0.28.3","typescript":"^5.8.3"},"_hasShrinkwrap":false,"devDependencies":{"@biomejs/biome":"^1.9.4"},"_npmOperationalInternal":{"tmp":"tmp/typedoc-plugin-example-utils-ts_1.0.1_1745898946270_0.6507308172704782","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@aigne/typedoc-plugin-example-utils-ts","version":"1.0.2","keywords":[],"author":{"name":"Yechao Li","email":"liyechao@yechao.xyz"},"license":"MIT","_id":"@aigne/typedoc-plugin-example-utils-ts@1.0.2","maintainers":[{"name":"li-yechao","email":"liyechao@yechao.xyz"},{"name":"wangshijun","email":"shijun@arcblock.io"}],"dist":{"shasum":"9747a107ed3558812c056b6092776e802eedcdcb","tarball":"https://registry.npmjs.org/@aigne/typedoc-plugin-example-utils-ts/-/typedoc-plugin-example-utils-ts-1.0.2.tgz","fileCount":8,"integrity":"sha512-tH9m5hvntFRWUTTYSwQmTHDgIfovma//PjTSnpR3putS5j3jGbEYrL3trhVzGvKSRX1HnQ9z3338BFczfuXJ1w==","signatures":[{"sig":"MEYCIQDySrX/8OdTWYJdxr7oeoS2L2Po9ht56oxLPeU1uTKskQIhAPJkEWavEBeJ8AhBNFCKbHVsYZ7wl1Ggj5jVKcXSbWKS","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9152},"main":"dist/index.js","type":"module","_from":"file:aigne-typedoc-plugin-example-utils-ts-1.0.2.tgz","types":"./dist/index.d.ts","gitHead":"d58c314c751906e3f12aede636d6f811b1f8b76b","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","prepublish":"npm run build"},"_npmUser":{"name":"li-yechao","email":"liyechao@yechao.xyz"},"_resolved":"/private/var/folders/tp/46k4cvdn6mv9rzqgy8br5b9r0000gn/T/5bd2207eeb35cecf8e95579d98a0131b/aigne-typedoc-plugin-example-utils-ts-1.0.2.tgz","_integrity":"sha512-tH9m5hvntFRWUTTYSwQmTHDgIfovma//PjTSnpR3putS5j3jGbEYrL3trhVzGvKSRX1HnQ9z3338BFczfuXJ1w==","_npmVersion":"10.9.2","description":"A utils library for typedoc to process example codes","directories":{},"_nodeVersion":"23.11.0","dependencies":{"zod":"^3.24.3","typedoc":"^0.28.3","typescript":"^5.8.3"},"_hasShrinkwrap":false,"devDependencies":{"@biomejs/biome":"^1.9.4"},"_npmOperationalInternal":{"tmp":"tmp/typedoc-plugin-example-utils-ts_1.0.2_1745907686865_0.9643273592959964","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@aigne/typedoc-plugin-example-utils-ts","version":"1.0.3","keywords":[],"author":{"name":"Yechao Li","email":"liyechao@yechao.xyz"},"license":"MIT","_id":"@aigne/typedoc-plugin-example-utils-ts@1.0.3","maintainers":[{"name":"li-yechao","email":"liyechao@yechao.xyz"},{"name":"wangshijun","email":"shijun@arcblock.io"}],"dist":{"shasum":"c99ac908f4593c50dae04f7812c9e426f50ac45d","tarball":"https://registry.npmjs.org/@aigne/typedoc-plugin-example-utils-ts/-/typedoc-plugin-example-utils-ts-1.0.3.tgz","fileCount":8,"integrity":"sha512-r//jewUedSLQvuK4+geuVoBVNyTnl8UQbgq4jExYqE70qf/Nku/b5CgrzTs/6EJsSMyFp3VyIj+zTW3ZoVniDw==","signatures":[{"sig":"MEQCIE5nmdDcIfr14Y9zw5Xm3WmVd8Vr7AHhs2f23OWla0o2AiApXTV9ulkhTcxR3umDzZCUadJMlelw+PU0YpbBvv80AA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9695},"main":"dist/index.js","type":"module","_from":"file:aigne-typedoc-plugin-example-utils-ts-1.0.3.tgz","types":"./dist/index.d.ts","gitHead":"d58c314c751906e3f12aede636d6f811b1f8b76b","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","prepublish":"npm run build"},"_npmUser":{"name":"li-yechao","email":"liyechao@yechao.xyz"},"_resolved":"/private/var/folders/tp/46k4cvdn6mv9rzqgy8br5b9r0000gn/T/fb4bb60460196b33bd9c2e631995608e/aigne-typedoc-plugin-example-utils-ts-1.0.3.tgz","_integrity":"sha512-r//jewUedSLQvuK4+geuVoBVNyTnl8UQbgq4jExYqE70qf/Nku/b5CgrzTs/6EJsSMyFp3VyIj+zTW3ZoVniDw==","_npmVersion":"10.9.2","description":"A utils library for typedoc to process example codes","directories":{},"_nodeVersion":"23.11.0","dependencies":{"zod":"^3.24.3","typedoc":"^0.28.3","ts-morph":"^25.0.1","typescript":"^5.8.3","@biomejs/js-api":"^0.7.1","@biomejs/wasm-nodejs":"^1.9.4"},"_hasShrinkwrap":false,"devDependencies":{"@biomejs/biome":"^1.9.4"},"_npmOperationalInternal":{"tmp":"tmp/typedoc-plugin-example-utils-ts_1.0.3_1746780955987_0.5289979503420921","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-04-29T01:36:10.134Z","modified":"2026-01-21T06:21:40.303Z","1.0.0":"2025-04-29T01:36:10.431Z","1.0.1":"2025-04-29T03:55:46.454Z","1.0.2":"2025-04-29T06:21:27.093Z","1.0.3":"2025-05-09T08:55:56.152Z"},"author":{"name":"Yechao Li","email":"liyechao@yechao.xyz"},"license":"MIT","keywords":[],"description":"A utils library for typedoc to process example codes","maintainers":[{"email":"liyechao@yechao.xyz","name":"li-yechao"},{"email":"shijun@arcblock.io","name":"wangshijun"},{"email":"rob@arcblock.io","name":"mave99a"}],"readme":"# @aigne/typedoc-plugin-example-utils-ts\n\nA utility library for processing TypeDoc example code. This plugin allows you to remove specific function calls from code examples in the `@example` tags of TypeDoc documentation.\n\n## Installation\n\nUsing npm:\n\n```bash\nnpm install @aigne/typedoc-plugin-example-utils-ts --save-dev\n```\n\nUsing yarn:\n\n```bash\nyarn add @aigne/typedoc-plugin-example-utils-ts --dev\n```\n\nUsing pnpm:\n\n```bash\npnpm add @aigne/typedoc-plugin-example-utils-ts -D\n```\n\n## Features\n\nThis plugin helps you remove specific function calls from code examples in TypeDoc documentation. This is particularly useful in the following scenarios:\n\n- When your example code contains helper function calls that are only for demonstration purposes\n- When you want to display more concise code examples in your documentation\n- When you need to remove specific debugging or logging functions from examples\n\n## Configuration\n\nAdd the following options to your TypeDoc configuration file:\n\n```json\n{\n  \"plugin\": [\"@aigne/typedoc-plugin-example-utils-ts\"],\n  \"removeExpressionsFromExamples\": [\"spyOn\", \"expect\", \"jest.fn\"]\n}\n```\n\nThe `removeExpressionsFromExamples` option accepts an array of strings specifying the function names to be removed from the example code.\n\n## How It Works\n\nThe plugin processes all `@example` tags during TypeDoc's `resolveReflection` phase. It uses TypeScript's AST (Abstract Syntax Tree) analysis to identify and remove the specified function calls.\n\n## Example\n\nSuppose you have the following code with an `@example` tag:\n\n```typescript\n/**\n * Calculate the sum of two numbers\n *\n * @param a The first number\n * @param b The second number\n * @returns The sum of the two numbers\n *\n * @example\n * ```ts\n * const calculator = ...\n * spyOn(calculator, 'add');\n * const result = calculator.add(1, 2);\n * expect(result).toBe(3);\n * return result;\n * ```\n */\nfunction add(a: number, b: number): number {\n  return a + b;\n}\n```\n\nIf you configure `\"removeExpressionsFromExamples\": [\"spyOn\", \"expect\"]`, the example code in the generated documentation will become:\n\n```ts\nconst calculator = ...\nconst result = calculator.add(1, 2);\nreturn result;\n```\n\n## Development\n\nClone the repository and install dependencies:\n\n```bash\ngit clone <repository-url>\ncd typedoc-plugin-example-utils-ts\npnpm install\n```\n\nBuild the project:\n\n```bash\npnpm build\n```\n\n## License\n\nMIT © [Yechao Li](mailto:liyechao@yechao.xyz)\n","readmeFilename":"README.md"}