Env Protector


🤔 Why this extension?
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.
🚀 Features
- 🔒 Toggle Visibility of Environment Files: Easily toggle the visibility of environment files in the sidebar. This command modifies your workspace settings by adding
"**/.env*": true
to the files.exclude
section in your settings.json
.

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

- 🤐 Mask Sensitive Data: Automatically mask sensitive environment variables when viewing
.env
files. 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
.env
file. 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.

📦 Installation
You can install Env Protector either from the Visual Studio Code marketplace or manually using the steps below:
Manual Installation
- Download the
.vsix
file 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
.vsix
file.
� Building from Source
If you want to build Env Protector from source, follow these steps:
Prerequisites
- Node.js (version 14 or higher)
- npm (comes with Node.js)
- Git
Build Steps
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 .vsix
file that you can install manually.
Development Mode
For development and testing purposes, you can run the extension in watch mode:
npm run watch
This will automatically recompile the extension whenever you make changes to the source code.
Running with VS Code Run and Debug
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
(or Cmd+Shift+P
on Mac)
- Type "Tasks: Run Task"
- Select "npm: watch" to start automatic compilation
Launch the Extension Development Host:
- Press
F5
or go to Run and Debug
view (Ctrl+Shift+D
)
- Select "Run Extension" from the dropdown
- Click the play button or press
F5
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).
�👥 Contributing
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!
📄 License
This project is licensed under the GPL-3.0 license.