Skip to main content
Back to Extensions Directory
coc.nvim fallback icon

Import Cost Fast

Ruban S

Display import/require package size in the editor

Installation CommandVim prompt
:CocInstall coc-import-cost-fast
GitHub owner
Ruban S
Version
v3.7.0
Requirements
coc ^0.0.66
License
MIT
Repository
GitHub
npm latest published 2026-09-28Registry checked 2026-09-29Registry summary

Published Package Summary

Import Cost Fast — coc.nvim

See the bundle size of every import in Vim/Neovim.

Display import sizes as virtual text using coc.nvim. Powered by esbuild and es-module-lexer.

Example

Requirements

  • coc.nvim installed and configured
  • Code lens enabled in coc config

Installation

:CocInstall coc-import-cost-fast

Enable code lens (:CocConfig):

{
  "codeLens.enable": true
}

Features

  • Inline size display — minified, gzipped, and brotli sizes shown as virtual text
  • All import patterns — import, import *, import { }, require(), dynamic import()
  • Language support — JavaScript, TypeScript, Vue, and Svelte
  • Cached results — sizes cached per package + version for instant display
  • Tree-shake awareness — reports if a package supports tree-shaking
  • Brotli compression — shows brotli alongside gzip
  • Budget warnings — ⚠ over budget! when imports exceed configured budgetKB
  • Lighter alternatives — suggests smaller replacements (moment → dayjs, lodash → lodash-es)
  • Estimated sizes — ~ prefix when bundling falls back to entry file size

Credits

Forked from wix/import-cost, rewritten in TypeScript with esbuild and es-module-lexer.

License

MIT

Read the complete README
  • Display import/require package size in the editor
Activation Events
  • onLanguage:javascript
  • onLanguage:javascriptreact
  • onLanguage:javascript.jsx
  • onLanguage:typescript
  • onLanguage:typescript.tsx
  • onLanguage:typescript.jsx
  • onLanguage:typescriptreact
  • onLanguage:vue
  • onLanguage:svelte
Developer Resources

Want to build, test, or contribute to coc.nvim extensions? Explore our official SDK and testing toolkits.

Open Developer Guide

Version History

This published npm package does not include a history.md or changelog.md file. Browse its npm versions or repository releases for available release information.