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.6.0
Requirements
coc ^0.0.66
License
MIT
Repository
GitHub
npm latest published 2026-05-14Registry checked 2026-08-23Registry summary

Published Package Summary

Import Cost Fast — coc.nvim Extension

This extension will display inline in the editor the size of the imported package. The extension utilizes esbuild and SWC in order to detect the imported size. Example Image

Requirements

This is an extension for coc.nvim and requires that it be installed first.

Installation

Once you have coc.nvim installed, open Vim/Neovim, and execute:

:CocInstall coc-import-cost

You'll also need to enable the code lens feature in coc (:CocConfig):

"codeLens.enable": true

Features

Calculates the size of imports and requires. Currently supports:

  • Default importing: import Func from 'utils';
  • Entire content importing: import * as Utils from 'utils';
  • Selective importing: import {Func} from 'utils';
  • Selective importing with alias: import {orig as alias} from 'utils';
  • Submodule importing: import Func from 'utils/Func';
  • Require: const Func = require('utils').Func;
  • Supports both Javascript and Typescript

Why & How

We detail the why and how in this blog post: https://medium.com/@yairhaimo/keep-your-bundle-size-under-control-with-import-cost-vscode-extension-5d476b3c5a76

Credits

Forked from wix/import-cost, thanks to the wix team!

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
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.