
Security News
upm Launches as a Fast, Tiny Package Manager Written in TypeScript
upm uses Node.js to deliver fast npm installs in about 250 KB, with a JavaScript API and security defaults.
@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 366 weekly downloads. As such, @galaxy-stack/orbit-config popularity was classified as not 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.

Security News
upm uses Node.js to deliver fast npm installs in about 250 KB, with a JavaScript API and security defaults.

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.