UNPKG

atikin-env-toolkit

Version:

Smart .env manager with validation, encryption, and multi-env switching. Created by Atikin Verse.

14 lines (11 loc) 344 B
const fs = require('fs'); function switchEnv(env) { const targetFile = `.env.${env}`; if (!fs.existsSync(targetFile)) { console.error(`Target env file ${targetFile} does not exist`); return; } fs.copyFileSync(targetFile, '.env'); console.log(`Switched to ${targetFile}`); } module.exports = { switchEnv };