Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Open Node DependencyNew to Visual Studio Code? Get it now.
Open Node Dependency

Open Node Dependency

Guillem GS

| (0) | Free
Navigate to the package.json of a dependency in node_modules
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Open Node Dependency

A VS Code/Cursor extension that enables Cmd+click (or Ctrl+click) navigation on dependency names in package.json files to open the corresponding package.json in node_modules. Useful when debugging version mismatches or writing patches for third-party modules.

Features

  • Quick Navigation: Cmd+click (Mac) or Ctrl+click (Windows/Linux) on any dependency name in package.json to open its package.json file
  • Multiple Dependency Types: Works with dependencies, devDependencies, peerDependencies, and optionalDependencies
  • Scoped Packages: Fully supports scoped packages (e.g., @scope/package)
  • Automatic Detection: Only creates links for packages that exist in node_modules

Usage

  1. Open any package.json file in your workspace
  2. Hold Cmd (Mac) or Ctrl (Windows/Linux) and click on any dependency name
  3. The extension will open node_modules/{package}/package.json in a new editor

Installation

From Source

  1. Clone this repository
  2. Run npm install to install dependencies
  3. Run npm run compile to build the extension
  4. Press F5 in VS Code to open a new Extension Development Host window
  5. Open a package.json file and test the cmd+click functionality

Package for Distribution

  1. Install vsce: npm install -g @vscode/vsce
  2. Run vsce package to create a .vsix file
  3. Install the .vsix file via code --install-extension open-node-dependency-0.0.1.vsix

Requirements

  • VS Code 1.105.0 or higher
  • Node.js project with node_modules directory

How It Works

The extension registers a DefinitionProvider for package.json files. When you Cmd+hover over a dependency name, it:

  1. Parses the JSON using jsonc-parser to build an AST with source positions
  2. Checks if the cursor is within a dependency key
  3. Returns a location pointing to node_modules/{package}/package.json
  4. Only provides navigation for packages that actually exist in node_modules

Known Limitations

Partial Underline on Hyphenated Packages

When hovering over packages with hyphens (e.g., jsonc-parser) or scoped packages (e.g., @types/node), VS Code only underlines the word segment under the cursor, not the full package name.

This is a VS Code limitation: the editor uses word boundaries for the hover highlight, and characters like -, /, and @ are treated as word separators. The navigation still works correctly — clicking anywhere within the package name will open the correct file.

Development

# Install dependencies
npm install

# Compile TypeScript
npm run compile

# Watch for changes
npm run watch

License

See LICENSE file for details.

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