{"id":14775,"library":"nundler","title":"Nundler (Not a Bundler)","description":"Nundler (version 0.2.0) is an early-stage utility designed for JavaScript and TypeScript projects that explicitly aim to *avoid* traditional bundling paradigms, or for workflows where fine-grained control over module resolution and dependency analysis is preferred over monolithic output. Instead of merging and optimizing code into a single or few output files, Nundler focuses on assisting developers in understanding and managing module graphs in an unbundled context. Its release cadence is currently unpredictable given its alpha status. Key differentiators include its focus on unbundled environments, potentially offering tools for dynamic import analysis, dependency introspection, or optimized loading strategies without modifying source code for bundling purposes. This tool could be beneficial for scenarios like serverless functions with strict individual file size limits, or development environments emphasizing native ESM module loading directly in Node.js.","status":"active","version":"0.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/mockingbot/nundler","tags":["javascript"],"install":[{"cmd":"npm install nundler","lang":"bash","label":"npm"},{"cmd":"yarn add nundler","lang":"bash","label":"yarn"},{"cmd":"pnpm add nundler","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Primary utility for dependency analysis. Nundler primarily targets modern Node.js environments and recommends ESM imports.","wrong":"const { analyzeDependencies } = require('nundler')","symbol":"analyzeDependencies","correct":"import { analyzeDependencies } from 'nundler'"},{"note":"A specific utility for resolving module paths in an unbundled context. Not a default export.","wrong":"import resolveModulePath from 'nundler'","symbol":"resolveModulePath","correct":"import { resolveModulePath } from 'nundler'"},{"note":"Type import for the structure returned by analysis functions. Important for TypeScript users.","symbol":"DependencyGraph","correct":"import type { DependencyGraph } from 'nundler'"}],"quickstart":{"code":"import { analyzeDependencies } from 'nundler';\nimport * as path from 'node:path';\nimport * as fs from 'node:fs/promises';\n\nasync function main() {\n  const projectRoot = process.cwd(); // Or a specific path, e.g., './src'\n  console.log(`Analyzing dependencies in: ${projectRoot}`);\n\n  try {\n    const analysisResult = await analyzeDependencies(projectRoot, {\n      entryPoints: ['index.js', 'main.ts'], // Specify your main entry points\n      ignoreNodeModules: true,\n      // further options to control analysis depth or file types\n    });\n\n    console.log('--- Dependency Graph Summary ---');\n    if (analysisResult.graph) {\n      console.log(`Total modules found: ${analysisResult.graph.nodes.length}`);\n      console.log(`Total dependencies: ${analysisResult.graph.edges.length}`);\n      // Example: Log unique external dependencies\n      const externalDeps = new Set(analysisResult.graph.edges\n        .filter(edge => edge.type === 'external')\n        .map(edge => edge.target));\n      console.log('External dependencies:', Array.from(externalDeps).join(', '));\n    } else {\n      console.log('No dependency graph generated, check entry points and options.');\n    }\n\n    if (analysisResult.errors && analysisResult.errors.length > 0) {\n      console.warn('\\n--- Warnings/Errors during analysis ---');\n      analysisResult.errors.forEach(err => console.warn(`- ${err.message} (File: ${err.file})`));\n    }\n\n  } catch (error) {\n    console.error('An error occurred during analysis:', error);\n  }\n}\n\nmain().catch(console.error);\n","lang":"typescript","description":"Demonstrates how to use `analyzeDependencies` to inspect a project's module graph without bundling, logging a summary of internal and external dependencies."},"warnings":[{"fix":"Always pin to an exact version (`\"nundler\": \"0.2.0\"`) and thoroughly test after any updates. Refer to GitHub issues for potential unannounced changes.","message":"As a pre-1.0 release (v0.2.0), Nundler's API is highly unstable and subject to frequent, significant breaking changes without prior notice. Semantic Versioning is not strictly followed for minor/patch releases at this stage.","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"Understand Nundler's core value proposition: unbundled dependency analysis and resolution. For bundling, use tools like Webpack, Rollup, or esbuild.","message":"Nundler is explicitly *not* a bundler. It will not optimize, transpile, or merge your code. Misinterpreting its purpose and expecting bundled output or performance optimizations from it will lead to incorrect assumptions and frustration.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Start with smaller sub-projects or specific entry points. Report performance issues on the GitHub repository with reproduction steps. Optimize your project's module structure where possible.","message":"Performance may vary significantly with very large codebases. Since Nundler aims to analyze individual modules, processing projects with tens of thousands of files or complex module resolution schemes might be slow.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Consult the latest source code or documentation (if available) on the GitHub repository for recent API changes. Ensure named imports match current exports.","cause":"Attempting to use an API method that has been renamed, removed, or is not correctly imported due to API instability in pre-1.0 versions.","error":"TypeError: Cannot read properties of undefined (reading 'someMethod')"},{"fix":"Run `npm install nundler` or `yarn add nundler` in your project directory. If using ESM, ensure your `package.json` has `\"type\": \"module\"` or use `.mjs` files.","cause":"The `nundler` package is not installed or not resolvable in the current project context.","error":"Error: Cannot find module 'nundler' from '<your-project-path>'"}],"ecosystem":"npm"}