README.md

April 22, 2026 ยท View on GitHub

Lazy Install

๐Ÿš€ Lazy Install

VS Code extension to auto install missing npm packages from import statements

Visual Studio Marketplace Version Visual Studio Marketplace Downloads GitHub License

English | ็ฎ€ไฝ“ไธญๆ–‡

Lazy Install detects missing dependencies in JavaScript, TypeScript, React, and Vue files, then lets you install them with one click via npm, pnpm, yarn, or ni.


โœจ Why Lazy Install for VS Code?

Stop the tedious workflow! ๐Ÿ›‘

โŒ Before: Import โ†’ Copy package name โ†’ Switch to terminal โ†’ Type install command โ†’ Wait โ†’ Switch back to editor โœ… After: Import โ†’ Click install button โ†’ Done! ๐ŸŽ‰

Lazy Install automatically detects uninstalled packages in import, export from, require(), and import() statements, then provides one-click install buttons directly in the editor. No more terminal switching or copy-pasting package names.

๐ŸŽฏ Features

  • ๐Ÿ” Missing Package Detection: Automatically scans import statements for dependencies that are not installed yet
  • โšก One-Click Install: Install npm packages instantly with inline CodeLens actions
  • ๐Ÿ› ๏ธ Multiple Package Managers: Supports npm, pnpm, yarn, and ni
  • ๐Ÿงฉ Common Import Forms: Supports import, export from, require(), and import()
  • ๐Ÿ“ฆ Dev Dependencies: Choose between regular dependencies and dev dependencies
  • ๐Ÿ”ง Monorepo Support: Works with pnpm workspaces and package.json workspaces
  • ๐Ÿš€ Zero Configuration: Works out of the box for JavaScript, TypeScript, React, and Vue projects

Just import and click - it's that simple!

๐Ÿš€ Quick Start

  1. Install the extension from VS Code Marketplace
  2. Write a missing import such as import axios from 'axios'
  3. Click the inline install button above the import
  4. Done! The missing dependency is installed and ready to use

โš™๏ธ Configuration

Customize your package manager in VS Code settings:

{
  "lazy-install.way": "pnpm" // Options: "ni", "npm", "pnpm", "yarn"
}

Supported Package Managers:

  • ๐Ÿ”ง ni (default) - Universal package manager
  • ๐Ÿ“ฆ npm - Node Package Manager
  • โšก pnpm - Fast, disk space efficient
  • ๐Ÿงถ yarn - Reliable, secure, fast

๐Ÿ› ๏ธ Supported Languages

  • โœ… JavaScript (.js)
  • โœ… TypeScript (.ts)
  • โœ… React (.jsx, .tsx)
  • โœ… Vue (.vue)

๐Ÿ’ก Pro Tips

  • Regular Dependency: Click the package name button
  • Dev Dependency: Click the "package-name -D" button
  • Common Import Styles: Works with import, require(), and import()
  • Monorepos: Detects pnpm workspaces and package.json workspaces

โ“ FAQ

Does Lazy Install work with monorepos?

Yes. It detects pnpm workspaces and package.json workspaces, then installs dependencies in the current package instead of always using the repository root.

Which import styles are supported?

Lazy Install detects packages referenced by import, export from, require(), and import() syntax in supported files.

Can I install dev dependencies?

Yes. Each missing package gets both a regular install action and a -D install action in the CodeLens UI.

๐Ÿค Contributing

Contributions are welcome! Feel free to:

  • ๐Ÿ› Report bugs
  • ๐Ÿ’ก Suggest features
  • ๐Ÿ”ง Submit pull requests
  • โญ Star the project

๐Ÿ“„ License

MIT ยฉ Simon He

โ˜• Support

If this extension saves you time, consider buying me a coffee! โ˜•

Sponsor

๐Ÿ™ Sponsors


Made with โค๏ธ by Simon He