npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@codegeekdevs/vite-encrypt-file

v1.0.2

Published

A Vite plugin that automatically encrypts and decrypts chosen files during development and build processes.

Readme

@codegeekdevs/vite-encrypt-file

A Vite plugin that automatically encrypts and decrypts chosen files during development and build processes.

Features

  • Automatic Encryption/Decryption: Process files on build start based on configured actions
  • File Watching: Automatically encrypt files when they change during development
  • Flexible Configuration: Support for multiple files with different encryption needs
  • Security: Protect sensitive configuration files and environment data

Installation

npm install @codegeekdevs/vite-encrypt-file

Usage

Add the plugin to your vite.config.js:

import { defineConfig } from 'vite';
import encrypt from '@codegeekdevs/vite-encrypt-file';

export default defineConfig({
    plugins: [
        encrypt({
            password: 'your-encryption-password',
            create: [
                { action: 'decrypt', src: '.env.encrypted', dest: '.env' },
                { action: 'encrypt', src: '.env', dest: '.env.encrypted' }
            ],
            watch: [
                { src: '.env', dest: '.env.encrypted' }
            ]
        })
    ]
});

Configuration

Options

  • password (required): The encryption/decryption password
  • create (optional): Array of actions to perform on build start
  • watch (optional): Array of files to watch and encrypt when changed

Create Actions

Each item in the create array should have:

  • action: Either 'encrypt' or 'decrypt'
  • src: Source file path
  • dest: Destination file path

The plugin only processes create actions when the source file exists and the destination file doesn't exist.

Watch Configuration

Each item in the watch array should have:

  • src: Source file path to watch
  • dest: Destination file path for encrypted output

When a watched file changes, it will be automatically encrypted to the destination path.

Example Use Cases

Protecting Environment Files

Decrypt an encrypted .env file on start, and re-encrypt it when changes are made:

encrypt({
    password: 'my-secret-key',
    create: [
        {
            action: 'decrypt',
            src: '.env.encrypted',
            dest: '.env'
        }
    ],
    watch: [
        {
            src: '.env',
            dest: '.env.encrypted'
        }
    ]
})

Encrypting Configuration Files

Encrypt sensitive configuration files during development:

encrypt({
    password: 'my-secret-key',
    watch: [
        {
            src: 'config/secrets.json',
            dest: 'config/secrets.json.encrypted'
        }
    ]
})

Security Considerations

  • Keep your encryption password secure and never commit it to version control
  • Use environment variables for passwords in production
  • Add decrypted files to .gitignore to prevent accidental commits
  • Store only encrypted versions of sensitive files in your repository

License

MIT

Author

David Faltermier [email protected]

Repository

https://gitlab.com/codegeekdev/node-package-vite-encrypt-file

Issues

https://gitlab.com/codegeekdev/node-package-vite-encrypt-file/issues