{"id":18280,"library":"docsgene","title":"Docsgene","description":"Docsgene (v1.0.0) is an AI-focused tool that bundles codebase context into a single file optimized for LLM ingestion. It scans project files, intelligently selects relevant code, and outputs a compact representation that preserves dependencies and structure, reducing token overhead. Released as initial stable version; no established release cadence yet. Key differentiator: purpose-built for LLM context windows, unlike generic bundlers.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install docsgene","lang":"bash","label":"npm"},{"cmd":"yarn add docsgene","lang":"bash","label":"yarn"},{"cmd":"pnpm add docsgene","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only; CommonJS require() will fail. TypeScript types available.","wrong":"const bundleCodebase = require('docsgene')","symbol":"bundleCodebase","correct":"import { bundleCodebase } from 'docsgene'"},{"note":"Type-only export; do not use as runtime value.","wrong":"import { DocsgeneConfig } from 'docsgene' (will cause runtime error if used as value)","symbol":"DocsgeneConfig","correct":"import type { DocsgeneConfig } from 'docsgene'"},{"note":"Default export for quick access to main function; named export also available.","wrong":"import { default } from 'docsgene'","symbol":"default","correct":"import docsgene from 'docsgene'"}],"quickstart":{"code":"import { bundleCodebase } from 'docsgene';\n\nconst result = await bundleCodebase({\n  sourceDir: './src',\n  outputFile: './context.txt',\n  ignorePatterns: ['node_modules', 'dist'],\n  maxTokens: 8000,\n  includeComments: false,\n});\n\nconsole.log('Bundled context written to', result.outputPath);\nconsole.log('Token count:', result.tokenCount);","lang":"typescript","description":"Shows how to import and use the main bundleCodebase function to generate an LLM-friendly context file from a source directory."},"warnings":[{"fix":"Use import syntax. If using Node.js, set \"type\": \"module\" in package.json or use .mjs extension.","message":"ESM-only: package does not support CommonJS require().","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Explicitly pass ignorePatterns for all non-essential directories.","message":"Default ignore patterns may not exclude large directories like .git or build outputs; can cause token overflow.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Monitor tokenCount in result and adjust maxTokens or ignorePatterns accordingly.","message":"maxTokens setting does not strictly enforce token limit; it's a guideline for chunking.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use import { bundleCodebase } from 'docsgene' or const { bundleCodebase } = await import('docsgene').","cause":"Using CommonJS require() on an ESM-only package, getting the module's default export object instead of named export.","error":"TypeError: docsgene_1.bundleCodebase is not a function"},{"fix":"Add \"type\": \"module\" to package.json, rename file to .mjs, or use dynamic import().","cause":"Running in a non-module context (e.g., plain .js file without type: module).","error":"SyntaxError: Cannot use import statement outside a module"},{"fix":"Run 'npm install docsgene' and ensure correct import path.","cause":"Package not installed or typo in package name.","error":"Module not found: Can't resolve 'docsgene' in 'C:\\project'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}