JSPM

  • Created
  • Published
  • Downloads 507999
  • Score
    100M100P100Q197633F
  • License MIT

Codebase intelligence for TypeScript and JavaScript. Finds unused code, duplication, circular dependencies, complexity hotspots, and architecture drift. Optional runtime intelligence layer (Fallow Runtime) adds production execution evidence. Rust-native, sub-second, 94 framework plugins.

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (fallow) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    fallow

    Codebase intelligence for TypeScript and JavaScript, built in Rust.

    CI npm MIT License

    Static analysis finds what is connected. Runtime intelligence finds what actually runs. Both land in the same report. The free static layer analyzes your codebase for unused files, exports, dependencies, and types, detects circular dependencies, finds duplicated code blocks, surfaces complexity hotspots, and enforces architecture boundaries. An optional paid runtime layer (Fallow Runtime) adds production execution evidence so you can delete and refactor with confidence. 5-41x faster than knip v5 (2-18x faster than knip v6), 8-29x faster than jscpd for duplication detection, with no Node.js runtime dependency.

    Static analysis is free and open source. Runtime intelligence is the paid team layer.

    Installation

    npm install --save-dev fallow   # or: pnpm add -D fallow / yarn add -D fallow / bun add -d fallow

    Installs the fallow CLI plus the companion fallow-lsp and fallow-mcp binaries in your project.

    The package also ships a version-matched Agent Skill under skills/fallow. TanStack Intent discovers it from node_modules automatically:

    npx @tanstack/intent list
    npx @tanstack/intent load fallow#fallow

    For one-off CLI use without project-local skill discovery, run npx fallow.

    Usage

    fallow                           # All analyses -- zero config, sub-second
    fallow dead-code                 # Unused code only
    fallow dupes                     # Duplication detection -- find copy-paste clones
    fallow dupes --mode semantic     # Catch clones with renamed variables
    fallow health                    # Complexity metrics -- cyclomatic + cognitive
    fallow fix --dry-run             # Preview auto-removal of unused exports and deps

    What it finds

    • Unused files -- not reachable from any entry point
    • Unused exports -- exported symbols never imported elsewhere
    • Unused types -- type aliases and interfaces never referenced
    • Unused dependencies -- packages in dependencies never imported
    • Unused devDependencies -- dev packages not referenced
    • Unused enum members -- enum values never referenced
    • Unused class members -- class methods and properties never referenced (tracks instance usage: const svc = new MyService(); svc.greet() counts greet as used)
    • Unresolved imports -- import specifiers that cannot be resolved
    • Unlisted dependencies -- imported packages missing from package.json
    • Duplicate exports -- same symbol exported from multiple modules
    • Circular dependencies -- import cycles in the module graph
    • Type-only dependencies -- production deps only used via import type

    Code duplication

    fallow dupes                       # Default: mild mode
    fallow dupes --mode semantic       # Catch clones with renamed variables
    fallow dupes --threshold 5         # Fail CI if duplication exceeds 5%
    fallow dupes --save-baseline       # Save current duplication as baseline

    4 detection modes (strict, mild, weak, semantic), clone family grouping with refactoring suggestions, baseline tracking, and cross-language TS/JS matching.

    Framework support

    94 built-in plugins covering Next.js, Nuxt, Remix, Qwik, SvelteKit, Gatsby, Astro, Angular, NestJS, Expo Router, Vite, Webpack, Vitest, Jest, Playwright, Cypress, Storybook, ESLint, TypeScript, Tailwind, UnoCSS, Prisma, Drizzle, Convex, Turborepo, Hardhat, and many more. Auto-detected from your package.json.

    Configuration

    Create a config file in your project root, or run fallow init:

    // .fallowrc.json
    {
      "$schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json",
      "entry": ["src/workers/*.ts", "scripts/*.ts"],
      "ignorePatterns": ["**/*.generated.ts"],
      "rules": {
        "unused-files": "error",
        "unused-exports": "warn",
        "unused-types": "off"
      }
    }

    Also supports TOML (fallow init --toml creates fallow.toml).

    Documentation

    License

    MIT