Import Quicken is yet another Visual Studio Code extension that helps quickly generating import
/require
snippets in JavaScript, TypeScript, and Stylus.
This extension is heavily inspired by Quick Require.
Available commands
- Add an import/require statement (default keybinding: Ctrl+Shift+I) – the extension scans your repository and list out files, exported identifiers, node modules from package.json, and imported identifiers from node modules. The coding convention, such as single/double quotes, semi-colons in JavaScript are recognized automatically without any further configurations.
- Fix broken import/require statements
- Convert require to import statements
Note that the extension may not support multi-folder workspace.
Basic usage
Simply press Ctrl+Shift+I on your keyboard to list all matching identifiers, and choose one file that you would like to insert a snippet based on it.
Fixing broken path in an import
/require
statement has never been this easy. The command Import Quicken: Fix Import/Require will try to find the closest match based on the file path without hassle. If more than one match is found, the extension will prompt you.
Advance usage
In order to populate Node.js APIs, such as child_process
, crypto
, fs
, and so on, the module @types/node
must be installed locally or globally using npm install @types/node
.
With the settings importQuicken.autoCopy
set to true
, your recently selected import name is automatically copied into the clipboard so you can paste it immediately without having to repeat yourself.