
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@zcodeapp/configuration
Advanced tools
The Configuration library is a robust and flexible solution for configuration management in TypeScript applications. It allows for the integration of multiple configuration strategies, facilitating adaptability across different environments and scenarios. With support for asynchronous loading and customizable strategies, this library is ideal for projects requiring an extensible and reliable configuration system.
Customizable Configuration Strategies
Integrate different configuration sources using customizable strategies.
Asynchronous Loading
Supports asynchronous loading of configuration data.
Extensive Logging
Comes with built-in logging capabilities for monitoring the configuration loading and retrieval process.
Scalable and Extendable
Easily scalable for complex applications, allowing the addition of new configuration strategies as needed.
Error Handling
Robust error handling during the configuration loading process.
Include the Configuration class in your TypeScript project:
npm install @zcodeapp/configuration @zcodeapp/logger
To use the Configuration class in your TypeScript project:
import { Di } from "@zcodeapp/di";
import { ExampleStrategy } from "exampleStrategy";
import { Configuration } from "@zcodeapp/configuration";
const di = Di.getInstance();
const config = di.get(Configuration);
const node_env = config.get("NODE_ENV");
addStrategy(strategy: IConfigurationStrategy): void
Add a new configuration strategy.
load(): Promise<void>
Asynchronously load configuration data using the added strategies.
get(key?: string): string
Retrieve a specific configuration value by key.
getData(): IConfigurationData[]
Get all loaded configuration data.
exampleStrategy.ts
export class ExampleStrategy implements IConfigurationStrategy {
public async load(): Promise<IConfigurationData[]> {
// load github, azure, gcp ...
}
}
main.ts
import { Configuration, EnvironmentStrategy } from "@zcodeapp/configuration";
import { Logger } from "@zcodeapp/logger";
// Get env values
const config = new Configuration(Logger.getInstance(), new EnvironmentStrategy());
const node_env = config.get("NODE_ENV");
@zcodeapp/diexampleStrategy.ts
import { Injectable } from "@zcodeapp/di";
@Injectable()
export class ExampleStrategy implements IConfigurationStrategy {
public async load(): Promise<IConfigurationData[]> {
// load github, azure, gcp ...
// return IConfigurationData[]
}
}
main.ts
import { Di } from "@zcodeapp/di";
import { ExampleStrategy } from "exampleStrategy";
import { Configuration } from "@zcodeapp/configuration";
const di = Di.getInstance();
const config = di.get(Configuration);
config.addStrategy(di.get(ExampleStrategy));
const custom_value = config.get("CUSTOM_VALUE");
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
Configuration for load system variables
The npm package @zcodeapp/configuration receives a total of 0 weekly downloads. As such, @zcodeapp/configuration popularity was classified as not popular.
We found that @zcodeapp/configuration demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.