Skip to content

Commit e44a267

Browse files
committed
feat: add dotenv benchmark
1 parent 3b0fee2 commit e44a267

File tree

5 files changed

+69
-1
lines changed

5 files changed

+69
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ packages operations.
1111
- [ ] webpack
1212
- [x] babel
1313
- [x] moment
14-
- [ ] dotenv
14+
- [x] dotenv
1515
- [ ] pinojs
1616
- [ ] winston
1717
- [ ] helmet

fixtures/.env.sample

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Database Configuration
2+
DB_HOST=localhost
3+
DB_PORT=5432
4+
DB_USERNAME=myusername
5+
DB_PASSWORD=mypassword
6+
DB_NAME=mydatabase
7+
8+
# API Keys
9+
API_KEY_1=your_api_key_1
10+
API_KEY_2=your_api_key_2
11+
API_KEY_3=your_api_key_3
12+
13+
# Server Configuration
14+
SERVER_HOST=127.0.0.1
15+
SERVER_PORT=8080
16+
17+
# Logging Configuration
18+
LOG_LEVEL=debug
19+
LOG_PATH=/var/log/myapp.log
20+
21+
# Authentication
22+
JWT_SECRET=your_jwt_secret
23+
OAUTH_CLIENT_ID=your_oauth_client_id
24+
OAUTH_CLIENT_SECRET=your_oauth_client_secret
25+
26+
# Email Configuration
27+
EMAIL_HOST=smtp.example.com
28+
EMAIL_PORT=587
29+
EMAIL_USERNAME=[email protected]
30+
EMAIL_PASSWORD=myemailpassword
31+
32+
33+
# AWS Configuration
34+
AWS_ACCESS_KEY_ID=your_aws_access_key_id
35+
AWS_SECRET_ACCESS_KEY=your_aws_secret_access_key
36+
AWS_REGION=us-east-1
37+
S3_BUCKET=my-s3-bucket
38+
39+
# Miscellaneous
40+
DEBUG_MODE=true
41+
CACHE_ENABLED=true

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"dependencies": {
33
"@babel/standalone": "7.24.0",
4+
"dotenv": "16.4.5",
45
"fastify": "4.26.1",
56
"lodash": "4.17.21",
67
"moment": "2.30.1",

pnpm-lock.yaml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/dotenv-benchmark.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const path = require('node:path');
2+
const dotenv = require('dotenv');
3+
4+
const envFile = path.join(__dirname, '..', 'fixtures', '.env.sample');
5+
6+
module.exports = {
7+
name: 'dotenv',
8+
type: 'operation',
9+
operations: [
10+
{
11+
name: 'config',
12+
fn: () => {
13+
return dotenv.config({ path: envFile });
14+
},
15+
},
16+
],
17+
benchmarker: 'benchmarkjs',
18+
};

0 commit comments

Comments
 (0)