Lodash is a JavaScript library that provides utility functions for common programming tasks, utilizing the functional programming paradigm. This extension integrates the powerfull string manipulation methods of Lodash into Visual Studio Code. With a simple hotkey, you can effortlessly convert text into various formats such as camelCase, kebab-case, snake_case, and more.
camelCase
capitalize
deburr
escape
kebabCase
lowerCase
lowerFirst
snakeCase
toLower
toUpper
trim
trimEnd
trimStart
unescape
upperCase
upperFirst
Need documentation on what these functions do?
Install through VS Code extensions, just search for Lodash String Tools
.
Visual Studio Code Market Place: Lodash String Tools
Can also be installed in VS Code: Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
ext install aleksei-iatsiuk.lodash-string-tools
Using Command Palette (CMD/CTRL + Shift + P):
- Select the text you want to change
- CMD/CTRL + Shift + P -> Lodash String Tools
You don't need to use the Command Palette all the time. Just create your own keybindings. Navigate to Settings -> Keyboard Shortcuts
and add a keybinding for the lodash-string-tools.commands
. Simply type Lodash String Tools
into the search bar to find the command.
Example of keybindings.json file:
{
"key": "shift+cmd+l",
"command": "lodash-string-tools.commands"
}
Now you can select the text in the editor and press Shift + Cmd + L
activate the extension commands menu.
In addition to the Lodash string methods, this extension also provides a few non-standard string methods:
- snakeCaseUpper - like snakeCase, but with uppercase letters, e.g. "fooBar" -> "FOO_BAR"
- capitalCamelCase - like camelCase, but with the first letter capitalized, e.g. "foo bar" -> "FooBar"