Most similar extensions hide environment files only after they are opened, which means sensitive information is briefly visible - even if for a short moment. This approach isn't ideal for streamers or anyone concerned about accidentally exposing sensitive data, especially since the toggle feature in other extensions isn't very user-friendly.
This extension takes a different approach: it asks you how you want to open the file before it's even opened, and operates according to your choice. This proactive protection ensures that sensitive information is never accidentally exposed during live streams or screen sharing.
- 🔒 Toggle Visibility of Environment Files: Easily toggle the visibility of environment files in the sidebar. This command modifies your workspace settings by adding
"**/.env*": trueto thefiles.excludesection in yoursettings.json.

- 🛑 Confirmation Prompt Before Opening: Prevent accidental exposure of sensitive data by receiving a confirmation prompt before opening an
.envfile. This safeguard adds an extra layer of security when handling critical environment variables.

- 🤐 Mask Sensitive Data: Automatically mask sensitive environment variables when viewing
.envfiles. Variable values are replaced with asterisks, allowing you to review the structure of the file without compromising the actual data.

- ➕ Add Environment Value Without Opening: Insert new environment variables directly from the command palette without needing to open the
.envfile. This feature minimizes exposure risks while making it easy to update your environment.
- ✍️ Edit Environment Value Without Opening: Quickly edit an existing environment variable from your enviroment files without exposing their contents in the editor.

- ➖ Remove Environment Value Without Opening: Easily remove environment variables from your environment files, again without exposing their contents in the editor.

You can install Env Protector either from the Visual Studio Code marketplace or manually using the steps below:
- Download the
.vsixfile from the releases page. - Open Visual Studio Code.
- Navigate to the Extensions view by clicking the Extensions icon in the Activity Bar.
- Click the ellipsis (...) in the top right corner of the Extensions view.
- Select "Install from VSIX..." and choose the downloaded
.vsixfile.
If you want to build Env Protector from source, follow these steps:
- Node.js (version 14 or higher)
- npm (comes with Node.js)
- Git
-
Clone the repository:
git clone https://github.com/sametcn99/env-protector.git cd env-protector -
Install dependencies:
npm install
-
Compile the extension:
npm run compile
-
Package the extension (optional):
npm run vsce
This will create a
.vsixfile that you can install manually.
For development and testing purposes, you can run the extension in watch mode:
npm run watchThis will automatically recompile the extension whenever you make changes to the source code.
You can also run and debug the extension directly within VS Code:
-
Open the project in VS Code:
code . -
Start the watch task (optional but recommended):
- Press
Ctrl+Shift+P(orCmd+Shift+Pon Mac) - Type "Tasks: Run Task"
- Select "npm: watch" to start automatic compilation
- Press
-
Launch the Extension Development Host:
- Press
F5or go toRun and Debugview (Ctrl+Shift+D) - Select "Run Extension" from the dropdown
- Click the play button or press
F5
- Press
This will open a new VS Code window (Extension Development Host) with your extension loaded. You can test all the extension features in this environment, and any changes you make to the code will be reflected after reloading the window (Ctrl+R in the Extension Development Host).
Contributions are highly welcome! If you'd like to help improve Env Protector, please follow these steps:
- Fork the repository to your own GitHub account.
- Create a new branch for your feature or bug fix.
- Make your changes and test them thoroughly.
- Submit a pull request, describing your changes in detail.
Together, we can make Env Protector an even more valuable tool for the community!
Thank you for your contributions!
This project is licensed under the GPL-3.0 license.
