
Research
/Security News
OpenAPI React Query Codegen Compromised in Mini Shai-Hulud npm Supply Chain Attack
Ten malicious OpenAPI React Query Codegen versions were published to npm in the Mini Shai-Hulud attack, all with valid provenance.
@edirect/config
Advanced tools
Global NestJS configuration module for eDirect applications. Provides environment variable loading via dotenv and a ConfigService for accessing configuration values across the application.
.{NODE_ENV}.env file automatically on startup (e.g., .development.env, .production.env)ConfigService anywhereget(key) / getConfig() APIConfigService) and string constant (CONFIG_SERVICE_TOKEN)pnpm add @edirect/config
# or
npm install @edirect/config
import { Module } from '@nestjs/common';
import { ConfigModule } from '@edirect/config';
@Module({
imports: [ConfigModule],
})
export class AppModule {}
Because ConfigModule is decorated with @Global(), you only need to import it once at the root module. ConfigService will be available for injection in all feature modules automatically.
import { Injectable } from '@nestjs/common';
import { ConfigService } from '@edirect/config';
@Injectable()
export class MyService {
constructor(private readonly config: ConfigService) {}
doSomething() {
const dbUrl = this.config.get('DATABASE_URL');
const port = this.config.get('PORT') ?? '3000';
}
}
ConfigService| Method | Signature | Description |
|---|---|---|
constructor | (filePath?: string) | Optionally pass a .env file path. Automatically called with .{NODE_ENV}.env by the module. |
get | (key: string): string | undefined | Returns the value for the given environment variable key from process.env. |
getConfig | (): IStringMapper | Returns all environment variables as a Record<string, string>. |
CONFIG_SERVICE_TOKENAn alternative injection token (string constant) for ConfigService. Useful when you need to inject by token rather than by class:
import { Inject } from '@nestjs/common';
import { CONFIG_SERVICE_TOKEN, ConfigService } from '@edirect/config';
constructor(@Inject(CONFIG_SERVICE_TOKEN) private config: ConfigService) {}
The module automatically loads .{NODE_ENV}.env from the working directory:
NODE_ENV | File loaded |
|---|---|
development (default) | .development.env |
staging | .staging.env |
production | .production.env |
test | .test.env |
Example .development.env:
PORT=3000
DATABASE_URL=mongodb://localhost:27017/mydb
REDIS_URL=redis://localhost:6379
LOGS_LEVEL=debug
Note: Never commit
.envfiles containing sensitive credentials to version control.
export { ConfigModule } from './config/config.module';
export { ConfigService } from './config/config.service';
export { CONFIG_SERVICE_TOKEN } from './config/config.constants';
export type { IStringMapper } from './config/config.interfaces';
FAQs
Unknown package
The npm package @edirect/config receives a total of 1,170 weekly downloads. As such, @edirect/config popularity was classified as popular.
We found that @edirect/config demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 29 open source maintainers collaborating on the project.

Research
/Security News
Ten malicious OpenAPI React Query Codegen versions were published to npm in the Mini Shai-Hulud attack, all with valid provenance.

Security News
Socket joins more than 100 technology, cybersecurity, and financial organizations calling for a global surge in cyber defense.

Product
Enterprise security teams can now detect malware, credential theft, suspicious network activity, and risky updates across Microsoft Edge extensions.