
Company News
Socket Joins New OpenJS Program to Fund Node.js Security Work
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.
@galaxy-stack/orbit-config
Advanced tools
Module quản lý cấu hình cho Orbit với hỗ trợ environment variables và Zod validation.
import { ConfigService } from '@galaxy-stack/orbit-config';
class MyService {
constructor(private config: ConfigService) {}
getDatabaseUrl() {
return this.config.get<string>('DATABASE_URL');
}
getPort() {
return this.config.get<number>('PORT', 3000); // Với default value
}
}
import { z } from 'zod';
import { ConfigModule } from '@galaxy-stack/orbit-config';
const configSchema = z.object({
PORT: z.coerce.number().default(3000),
DATABASE_URL: z.string().url(),
JWT_SECRET: z.string().min(32),
NODE_ENV: z.enum(['development', 'production', 'test']),
});
@Module({
imports: [
ConfigModule.forRoot({
schema: configSchema,
envFile: '.env',
}),
],
})
class AppModule {}
import { registerAs } from '@galaxy-stack/orbit-config';
// database.config.ts
export default registerAs('database', () => ({
host: process.env.DB_HOST,
port: parseInt(process.env.DB_PORT || '5432'),
name: process.env.DB_NAME,
}));
// Sử dụng
const dbConfig = this.config.get('database');
console.log(dbConfig.host);
ConfigModule.forRoot({
envFile: '.env',
isGlobal: true,
})
ConfigModule.forRoot({
schema: z.object({
PORT: z.coerce.number(),
API_KEY: z.string(),
}),
envFile: '.env',
})
ConfigModule.forRootAsync({
useFactory: async () => ({
envFile: '.env',
schema: mySchema,
}),
})
.env - Default.env.local - Local overrides.env.development - Development.env.production - Production.env.test - Testinginterface ConfigService {
get<T>(key: string): T | undefined;
get<T>(key: string, defaultValue: T): T;
getOrThrow<T>(key: string): T;
has(key: string): boolean;
}
interface DatabaseConfig {
host: string;
port: number;
name: string;
}
const dbConfig = config.get<DatabaseConfig>('database');
FAQs
Configuration module for Orbit framework
The npm package @galaxy-stack/orbit-config receives a total of 1,539 weekly downloads. As such, @galaxy-stack/orbit-config popularity was classified as popular.
We found that @galaxy-stack/orbit-config demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Company News
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.

Security News
Two compromised GitHub Actions were re-enabled with malicious tags intact, exposing thousands of downstream repositories to Mini Shai-Hulud.

Research
/Security News
A malicious Firefox extension fetches its payload after installation to evade detection, steal Google session cookies, and automate account takeover.