Require to CamelCase

A VS Code extension that automatically converts require() statements to camelCase const declarations with a single keystroke.
Demo

Features
- Quick Conversion: Transform
require() statements instantly with Alt+Q
- Smart Naming: Automatically generates camelCase variable names from module names
- Multi-Language Support: Works with JavaScript, TypeScript, JSX, and TSX files
- Clean Output: Produces clean, readable const declarations
Usage
- Place your cursor on a
require() statement
- Press
Alt+Q or use the command palette
- The statement is instantly converted to a camelCase const declaration
Examples
Before:
require("express");
require("lodash");
require("react-router-dom");
require("./utils/helper");
After (Alt+Q):
const express = require("express");
const lodash = require("lodash");
const reactRouterDom = require("react-router-dom");
const helper = require("./utils/helper");
Installation
From VS Code Marketplace
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X)
- Search for "Require to CamelCase"
- Click Install
From Command Line
code --install-extension IndigoQiu.require-to-camelcase
From Marketplace Website
Visit the VS Code Marketplace and click "Install".
Commands
| Command |
Keyboard Shortcut |
Description |
Convert to CamelCase Const Declaration |
Alt+Q |
Converts require statement to camelCase const |
Supported File Types
- JavaScript (
.js)
- TypeScript (
.ts)
- React JSX (
.jsx)
- React TSX (
.tsx)
Configuration
This extension works out of the box with no configuration needed. Simply install and start using Alt+Q to convert your require statements.
Contributing
Found a bug or have a feature request? Please create an issue on our GitHub repository.
Enjoy coding with cleaner require statements!
| |