Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Array Size ExtensionNew to Visual Studio Code? Get it now.
Array Size Extension

Array Size Extension

Preview

Vincent Devalliere

|
56 installs
| (5) | Free
Display the size of arrays in JavaScript, TypeScript, and JSON code with intuitive inlay hints.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Array Size Extension

Array Size Extension Logo

Never Lose Track of Your Array Sizes Again

Array Size Extension provides intuitive inlay hints that display the size of arrays right in your JavaScript, TypeScript, and JSON code. This makes it easier to understand and manage your code without having to manually count array elements.

Demo Screenshot

Features

  • Real-time Array Size Display: See the size of arrays directly in your code as inlay hints
  • Support for Complex Array Types: Works with arrays containing strings with commas, nested arrays, objects, and more
  • JavaScript, TypeScript & JSON Support: Fully compatible with these languages
  • Lightweight & Performance-Optimized: Minimal impact on your coding experience

How It Works

The extension analyzes your JavaScript, TypeScript, and JSON code to identify array literals and displays their size directly in your editor. For example:

// JavaScript
const simpleArray = [1, 2, 3, 4, 5]; // Shows "[5]"
const complexArray = ['a,b', { name: 'test' }, [1, 2]]; // Shows "[3]"
// JSON
{
  "items": [1, 2, 3, 4, 5],  // Shows "[5]"
  "nestedData": [
    {"id": 1, "name": "Item 1"},
    {"id": 2, "name": "Item 2"}
  ]  // Shows "[2]"
}

Working With Complex Arrays

Array Size Extension intelligently handles complex scenarios:

  • Strings with commas: ['a,b', 'c,d'] is correctly counted as 2 elements
  • Nested arrays: The extension counts top-level elements
  • Object literals: Objects in arrays are counted as single elements
  • Comments: Comments inside arrays are ignored for counting

Installation

  1. Open VS Code
  2. Go to Extensions (or press Ctrl+Shift+X)
  3. Search for "Array Size Extension"
  4. Click Install

Usage

The extension activates automatically when you open JavaScript, TypeScript, or JSON files. You'll immediately see the size hints at the end of array declarations.

Feedback & Contributions

  • Report an Issue
  • Request a Feature
  • Contribute

Buy Me a Coffee

If you appreciate the extension and would like to support its development, feel free to buy me a coffee! Your support helps keep the project alive and improving. ☕💖

License

This extension is licensed under the MIT License.

Credits

Created by Vincent Devalliere

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft