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

importlens

v3.2.1

Published

Intelligent import management with AST-based analysis, organization, and CI/CD integration

Readme

ImportLens Logo

NPM VS Code Marketplace

Intelligent import management for VS Code and CI/CD pipelines — detect, remove, and organize unused imports with AST-level precision across six languages.

Supported Languages

| Language | Detection | Organize Imports | |---|---|---| | TypeScript / JavaScript | Babel AST | Yes | | Python | Tree-sitter / regex | Yes — PEP 8 groups | | Java | Tree-sitter / regex | Yes — package groups | | Go | Tree-sitter / regex | Yes — stdlib / third-party | | Rust | Tree-sitter / regex | — | | C / C++ | Heuristic | — | | 50+ others | LSP | — |

Installation

VS Code — Extensions panel → search ImportLens → Install

CLI

npm install -g importlens

Enable Tree-sitter (optional, recommended for Python/Java/Go/Rust)

npm install --save-optional tree-sitter tree-sitter-python tree-sitter-java tree-sitter-go tree-sitter-rust

VS Code Commands

Open the Command Palette (Ctrl+Shift+P) and type ImportLens:

  • Clean Current File — remove unused imports from the active editor
  • Clean Workspace — remove unused imports across all open files
  • Organize Imports — sort and group imports by language convention
  • Show Team Dashboard — workspace health metrics with git contributor data
  • Show Import Statistics — historical trend charts
  • Toggle Safe Mode — preserve or allow removal of side-effect imports

CLI

# Detect unused imports
importlens-cli --check src/

# Auto-fix (safe mode preserves side-effect imports)
importlens-cli --fix --safe-mode src/

# CI/CD — annotate GitHub Actions with inline warnings
importlens-cli --check --format=github src/

# Baseline workflow — track debt without blocking the pipeline
importlens-cli --baseline-generate src/
importlens-cli --baseline-check src/

# Team analytics report
importlens-cli --analytics --analytics-output=report.json src/

Output formats: text · json · github · junit

The CLI automatically distributes work across CPU cores using worker threads for faster analysis in large monorepos.

CI/CD

- name: ImportLens — check unused imports
  run: |
    npm install -g importlens
    importlens-cli --check --format=github src/

Configuration

{
  "importlens.safeMode": true,
  "importlens.enableOnSave": false,
  "importlens.excludePatterns": ["**/node_modules/**", "**/dist/**"]
}

Documentation

User Guide · Architecture · Changelog · Contributing


MIT License · GitHub · NPM · VS Code Marketplace