{"_id":"@biratdatta/team-lead","name":"@biratdatta/team-lead","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@biratdatta/team-lead","version":"0.1.0","publishConfig":{"access":"public"},"description":"A lightweight, dependency-free library for cataloguing, tagging, and searching knowledge entries.","keywords":["knowledge","catalogue","catalog","knowledge-base","search","tags","index"],"license":"MIT","author":{"name":"Birat Datta","email":"birat.datta26@gmail.com"},"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"build":"tsup src/index.ts --format esm,cjs --dts --clean","test":"vitest run","test:watch":"vitest","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"engines":{"node":">=18"},"devDependencies":{"@types/node":"^20.19.43","tsup":"^8.0.0","typescript":"^5.4.0","vitest":"^1.6.0"},"_id":"@biratdatta/team-lead@0.1.0","_nodeVersion":"22.17.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-wZbPDMC+UqO0qJf/hGZ6ZHlZPBh9X4qL2qfF099hdJcaghjBO8XeIkC3X6xGT9rPPNrQYwnYLq51GbcNYiXIXw==","shasum":"ed1a5d554e9501073c1bfdb5a7c63f8534aaa037","tarball":"https://registry.npmjs.org/@biratdatta/team-lead/-/team-lead-0.1.0.tgz","fileCount":7,"unpackedSize":25091,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD1oDuIoGA55KXS5fDcCKlHwXpBevXIUiBQJjUDlSnBzwIhAMRNkgVAHtlipDyRMZSw0hELgE/Ib3GJSe9wrm1oZm3C"}]},"_npmUser":{"name":"biratdatta","email":"birat.datta26@gmail.com"},"directories":{},"maintainers":[{"name":"biratdatta","email":"birat.datta26@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/team-lead_0.1.0_1784047713519_0.8006106006882276"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-14T16:48:33.319Z","0.1.0":"2026-07-14T16:48:33.695Z","modified":"2026-07-14T16:48:33.929Z"},"maintainers":[{"name":"biratdatta","email":"birat.datta26@gmail.com"}],"description":"A lightweight, dependency-free library for cataloguing, tagging, and searching knowledge entries.","keywords":["knowledge","catalogue","catalog","knowledge-base","search","tags","index"],"author":{"name":"Birat Datta","email":"birat.datta26@gmail.com"},"license":"MIT","readme":"# knowledge-catalogue\n\nA lightweight, dependency-free library for cataloguing, tagging, and searching\nknowledge entries. Ships with full TypeScript types and both ESM and CommonJS\nbuilds.\n\n## Install\n\n```bash\nnpm install knowledge-catalogue\n```\n\n## Quick start\n\n```ts\nimport { KnowledgeCatalogue } from \"knowledge-catalogue\";\n\nconst catalogue = new KnowledgeCatalogue();\n\nconst entry = catalogue.add({\n  title: \"How OAuth works\",\n  content: \"The client redirects the user to the authorization server…\",\n  category: \"api\",\n  tags: [\"auth\", \"oauth\"],\n});\n\nconsole.log(entry.id); // auto-generated UUID\n\n// Relevance search across title, tags and content\nconst hits = catalogue.search(\"oauth\");\nconsole.log(hits[0].entry.title); // \"How OAuth works\"\n\n// Structured filtering\nconst apiDocs = catalogue.query({ category: \"api\", tags: [\"auth\"] });\n```\n\n## API\n\n### `new KnowledgeCatalogue(seed?)`\n\nCreate a catalogue, optionally seeded with an array of `NewEntryInput` objects.\n\n### Mutations\n\n| Method | Description |\n| --- | --- |\n| `add(input)` | Add an entry. Auto-fills `id`, timestamps, and normalizes tags. Returns the stored entry. |\n| `update(id, patch)` | Update the provided fields of an existing entry. Metadata is merged. |\n| `remove(id)` | Delete an entry. Returns `true` if one was removed. |\n| `clear()` | Remove all entries. |\n\n### Reads\n\n| Method | Description |\n| --- | --- |\n| `get(id)` | Return a copy of an entry, or `undefined`. |\n| `has(id)` | Whether an entry exists. |\n| `list()` | All entries, newest first. |\n| `categories()` | Distinct categories, sorted. |\n| `allTags()` | Distinct tags, sorted. |\n| `size` | Number of entries (getter). |\n\n### Search\n\n**`query(options)`** — structured filtering. All filters are ANDed:\n\n```ts\ncatalogue.query({\n  text: \"invoice\",       // case-insensitive substring on title + content\n  category: \"billing\",\n  tags: [\"urgent\"],      // must contain every tag\n  anyTags: [\"a\", \"b\"],   // must contain at least one tag\n  limit: 20,\n});\n```\n\n**`search(query, limit = 10)`** — weighted relevance search returning\n`{ entry, score }` hits sorted by score. Title matches score `5`, tag matches\n`3`, content matches `1` per term.\n\n### Persistence\n\n```ts\nconst json = JSON.stringify(catalogue);          // uses toJSON()\nconst restored = KnowledgeCatalogue.fromJSON(JSON.parse(json));\n```\n\n## Development\n\n```bash\nnpm install\nnpm test          # run vitest\nnpm run typecheck # tsc --noEmit\nnpm run build     # emit ESM + CJS + .d.ts to dist/\n```\n\n## License\n\nMIT © Birat Datta\n","readmeFilename":"README.md","_rev":"1-191be96f086a5b1c221712d1b138d43f"}