
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-common
Advanced tools
Package chứa các decorators, pipes, guards, interceptors và exceptions dùng chung trong Orbit framework.
import {
Controller,
Get, Post, Put, Patch, Delete,
Body, Query, Param, Headers, Req, Res
} from '@galaxy-stack/orbit-common';
@Controller('api')
class ApiController {
@Get('items')
getItems(@Query('page') page: string) {}
@Post('items')
createItem(@Body() data: any) {}
}
ParseIntPipe: Chuyển string thành numberParseFloatPipe: Chuyển string thành floatParseBoolPipe: Chuyển string thành booleanParseArrayPipe: Chuyển string thành arrayDefaultValuePipe: Giá trị mặc địnhTrimPipe: Xóa khoảng trắng@Get(':id')
getUser(@Param('id', ParseIntPipe) id: number) {
// id đã được convert sang number
}
import {
BadRequestException,
UnauthorizedException,
ForbiddenException,
NotFoundException,
ConflictException,
InternalServerErrorException,
} from '@galaxy-stack/orbit-common';
throw new NotFoundException('User not found');
import { CanActivate, ExecutionContext } from '@galaxy-stack/orbit-common';
class AuthGuard implements CanActivate {
canActivate(context: ExecutionContext): boolean {
const request = context.switchToHttp().getRequest();
return !!request.headers.authorization;
}
}
import { Interceptor, ExecutionContext } from '@galaxy-stack/orbit-common';
class LoggingInterceptor implements Interceptor {
async intercept(context: ExecutionContext, next: () => Promise<any>) {
console.log('Before...');
const result = await next();
console.log('After...');
return result;
}
}
import {
Controller, Get, UseGuards, UsePipes,
ParseIntPipe, AuthGuard
} from '@galaxy-stack/orbit-common';
@Controller('users')
@UseGuards(AuthGuard)
class UserController {
@Get(':id')
@UsePipes(ParseIntPipe)
getUser(@Param('id') id: number) {
return { id };
}
}
FAQs
Common decorators, pipes, guards, interceptors for Orbit
The npm package @galaxy-stack/orbit-common receives a total of 4,290 weekly downloads. As such, @galaxy-stack/orbit-common popularity was classified as popular.
We found that @galaxy-stack/orbit-common 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.