Comprehensive examples for encrypting secrets with Dotenvx in Node.js.
- Node.js 22+
- Optional: a Dotenvx account
cd javascript
npm install
npx dotenvx encrypt
node index.jscd typescript
npm install
npx dotenvx encrypt
npx tsx index.tsrequire('@dotenvx/dotenvx').config()
console.log('HELLO:', process.env.HELLO)nodejs-dotenvx-examples/
├── javascript/
│ ├── index.js
│ └── package.json
├── typescript/
│ ├── index.ts
│ ├── package.json
│ └── tsconfig.json
└── README.md