{"_id":"@dangzhuotong/cordis","name":"@dangzhuotong/cordis","dist-tags":{"latest":"4.0.1"},"versions":{"4.0.1":{"name":"@dangzhuotong/cordis","description":"Meta-Framework for Modern JavaScript Applications","version":"4.0.1","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/deepseek-ai/deepseek-harness.git","directory":"vendor/cordis"},"sideEffects":false,"type":"module","main":"lib/index.js","types":"lib/types/index.d.ts","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./src/*":"./src/*","./package.json":"./package.json"},"author":{"name":"Shigma","email":"shigma10826@gmail.com"},"license":"MIT","peerDependencies":{"@dangzhuotong/cordis-plugin-include":"^1.0.6","@dangzhuotong/cordis-plugin-loader":"^1.0.2"},"peerDependenciesMeta":{"@dangzhuotong/cordis-plugin-include":{"optional":true},"@dangzhuotong/cordis-plugin-loader":{"optional":true}},"dependencies":{"@standard-schema/spec":"^1.1.0","@dangzhuotong/cosmokit":"^1.8.2"},"bin":{"cordis":"bin.js"},"_id":"@dangzhuotong/cordis@4.0.1","gitHead":"53baf21dfae3d134fa248f36dafb4ab1fe28e55c","bugs":{"url":"https://github.com/deepseek-ai/deepseek-harness/issues"},"homepage":"https://github.com/deepseek-ai/deepseek-harness#readme","_integrity":"sha512-xb0Q1NZBF4iEjBAVMbwgPQu7oi7bOyJcFb2cfwYlS6torIVkds/tfbIWTvkdE8cXnvdJXDzGcDGRla/kyXWmvA==","_resolved":"D:\\Coding\\deepseek-harness-master\\dist\\npm\\vendor\\dangzhuotong-cordis-4.0.1.tgz","_from":"file:D:/Coding/deepseek-harness-master/dist/npm/vendor/dangzhuotong-cordis-4.0.1.tgz","_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-xb0Q1NZBF4iEjBAVMbwgPQu7oi7bOyJcFb2cfwYlS6torIVkds/tfbIWTvkdE8cXnvdJXDzGcDGRla/kyXWmvA==","shasum":"071de4fd84c1ca24ef8312670c5f388e9124498a","tarball":"https://registry.npmjs.org/@dangzhuotong/cordis/-/cordis-4.0.1.tgz","fileCount":32,"unpackedSize":239103,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC9wrC0/MMqp9mR3eL6eya9Rl31Xscc/FHsBxtIEpnfagIhAOt4STGzsXFeAf3xXsXZdVwuL9m4cYdjoVcyyuF/iSwA"}]},"_npmUser":{"name":"dangzhuotong","email":"353199054@qq.com"},"directories":{},"maintainers":[{"name":"dangzhuotong","email":"353199054@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cordis_4.0.1_1787281222717_0.39108668458852347"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-21T03:00:22.520Z","4.0.1":"2026-08-21T03:00:22.862Z","modified":"2026-08-21T03:00:23.079Z"},"maintainers":[{"name":"dangzhuotong","email":"353199054@qq.com"}],"description":"Meta-Framework for Modern JavaScript Applications","homepage":"https://github.com/deepseek-ai/deepseek-harness#readme","repository":{"type":"git","url":"git+https://github.com/deepseek-ai/deepseek-harness.git","directory":"vendor/cordis"},"author":{"name":"Shigma","email":"shigma10826@gmail.com"},"bugs":{"url":"https://github.com/deepseek-ai/deepseek-harness/issues"},"license":"MIT","readme":"# Cordis\n\nCordis is a TypeScript plugin framework for applications that need explicit\ndependency injection, scoped services, lifecycle-managed cleanup, and optional\nconfiguration-driven loading. The core package is published as `cordis`; the\nofficial packages in this repository add a loader, config-file includes, HMR,\nconsole logging, timers, and project scaffolding.\n\n## Install\n\n```sh\nyarn add cordis\n```\n\nCordis is ESM-first. The repository is tested on current Node releases, and the\nscaffolder requires Node 22 or newer.\n\n## Quick Start\n\n```ts\nimport { Context, Service } from 'cordis'\n\ndeclare module 'cordis' {\n  interface Context {\n    counter: Counter\n  }\n\n  interface Events {\n    'app/ready'(message: string): void\n  }\n}\n\nclass Counter extends Service {\n  value = 0\n\n  constructor(ctx: Context) {\n    super(ctx, 'counter')\n  }\n\n  next() {\n    return ++this.value\n  }\n}\n\nconst greeter = Object.assign((ctx: Context) => {\n  ctx.on('app/ready', (message) => {\n    ctx.logger.info('%s #%d', message, ctx.counter.next())\n  })\n}, {\n  inject: ['counter'],\n})\n\nconst root = new Context()\nawait root.plugin(Counter)\nawait root.plugin(greeter)\n\nroot.emit('app/ready', 'started')\nawait root.fiber.dispose()\n```\n\nThe important pieces are:\n\n- `new Context()` creates the root dependency container.\n- `ctx.plugin()` starts a plugin and returns a `Fiber`.\n- `inject` tells Cordis which services must exist before the plugin runs.\n- Effects, event listeners, and services are removed when their owning fiber is\n  disposed.\n\n## Documentation\n\n- [Tutorial: build a plugin](../../docs/tutorials/build-a-plugin.md)\n- [Guide: plugin lifecycle](../../docs/guides/plugin-lifecycle.md)\n- [Guide: loader configuration](../../docs/guides/loader-config.md)\n- [API reference](../../docs/api/core.md)\n\n## Packages\n\n| Package | Purpose |\n| --- | --- |\n| `cordis` | Core context, plugin registry, fiber lifecycle, events, services, and logger. |\n| `create-cordis` | Interactive project scaffolder. |\n| `@cordisjs/plugin-loader` | Runtime plugin tree and loader service. |\n| `@cordisjs/plugin-include` | YAML/JSON config-file include support for the loader. |\n| `@cordisjs/plugin-group` | Nested plugin groups for loader configs. |\n| `@cordisjs/plugin-hmr` | Hot module replacement for loader-managed plugins. |\n| `@cordisjs/plugin-logger-console` | Console exporter for the built-in logger. |\n| `@cordisjs/plugin-timer` | Disposal-aware timeout, interval, throttle, and debounce helpers. |\n| `@cordisjs/utils` | Shared utilities used by Cordis packages. |\n\n## Development\n\n```sh\nyarn install\nyarn build\nyarn test\nyarn lint\n```\n\nThe monorepo uses Yakumo to build and test all packages. Most examples in the\ndocs use public APIs from `cordis`; loader examples additionally use\n`@cordisjs/plugin-loader` and `@cordisjs/plugin-include`.\n","readmeFilename":"README.md","_rev":"1-3789ca1fba31d95dd9baf471f40e8243"}