npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@bemedev/codebase

v0.1.3

Published

The CLI for to generate codebase, and import partially a library. From @bemedev

Readme

@bemedev/codebase

License Node.js TypeScript

A powerful CLI to generate and analyze your TypeScript/JavaScript codebase. This tool allows partial importing of libraries and generates comprehensive analyses of your source code.

🚀 Main Features

  • 📊 Codebase analysis: Full analysis of imports, exports and dependencies
  • 🔧 Automatic generation: Creates detailed JSON analysis files
  • ⚡ Intuitive CLI: Simple and effective command-line interface
  • 📦 Partial import: Selective import of library parts
  • 🎯 Flexible exclusion: Ability to exclude specific files
  • 📈 Statistics: Detailed reports about your codebase

📋 Prerequisites

  • Node.js ≥ 22.0.0
  • pnpm (recommended) or npm/yarn

🛠️ Installation

Global installation (recommended)

pnpm add -g @bemedev/codebase

Local installation

pnpm add @bemedev/codebase

Development installation

pnpm add -D @bemedev/codebase

🎯 Usage

CLI

Generate a codebase analysis

# Basic analysis - generates a codebase.json file
@bemedev/codebase

# Specify a custom output file
@bemedev/codebase --output my-analysis.json

# Exclude specific files
@bemedev/codebase --exclude node_modules dist lib build

# Use short options
@bemedev/codebase -o output.json node_modules dist

Available options

  • -o, --output <file> : Output file (default: codebase.json)
  • [excludes...] : List of files/folders to exclude

Programmatic API

import { generate, analyze } from '@bemedev/codebase';

// Analyze the codebase
const analysis = analyze('src');

// Generate an analysis file
await generate({
  output: 'my-codebase.json',
  excludes: ['node_modules', 'dist'],
});

📊 Output format

The generated JSON file contains:

{
  "STATS": {
    "files": 42,
    "imports": 156,
    "exports": 89
  },
  "CODEBASE_ANALYSIS": {
    "src/index.ts": {
      "imports": ["./functions", "./types"],
      "relativePath": "src/index.ts",
      "text": "export * from './functions';"
    }
  }
}

🏗️ Project structure

src/
├── cli/           # CLI interface
├── functions/     # Core functions
│   ├── add.ts     # Add dependencies
│   ├── generate.ts # Generate analysis
│   ├── init.ts    # Initialization
│   └── remove.ts  # Removal
├── analyze.ts     # Analysis engine
├── types.ts       # TypeScript definitions
└── constants.ts   # Global constants

🧪 Development scripts

# Run tests
pnpm test

# Linting
pnpm lint

# Build
pnpm build

# Development mode with watch
pnpm dev

🎨 Examples

Analyze a React project

@bemedev/codebase -o react-analysis.json node_modules public build

Analyze a Node.js project

@bemedev/codebase -o backend-analysis.json node_modules dist coverage

Integrate into an NPM script

{
  "scripts": {
    "analyze": "@bemedev/codebase -o analysis/codebase.json",
    "analyze:clean": "@bemedev/codebase -o analysis/clean.json node_modules dist lib build"
  }
}

🤝 Contribution

Contributions are welcome! How to contribute:

  1. Fork the project
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Contribution guidelines

  • Follow commit conventions (Conventional Commits)
  • Add tests for new features
  • Update documentation when necessary
  • Respect existing code style

🐛 Report a bug

If you find a bug, please open an issue with:

  • A clear description of the problem
  • Steps to reproduce the bug
  • Your environment (OS, Node.js version, etc.)
  • Error logs if available

License (MIT)

CHANGE_LOG

Author

chlbri, my github

Links