
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@redhare/interceptors
Advanced tools
NestJS provide a Interceptor concept. Interceptors have a set of useful capabilities which are inspired by the Aspect Oriented Programming (AOP) technique. This package function is to collect commonly used interceptor.
NestJS provide a Interceptor concept. Interceptors have a set of useful capabilities which are inspired by the Aspect Oriented Programming (AOP) technique. This package function is to collect commonly used interceptor.
yarn add '@infra-node-kit/interceptors'
This interceptor wrap normal return value to data field of standard response. The standard response as follow:
{
data,
code: 0,
message: 'OK',
status: 200
}
@Res() response to skip the StandardResponseInterceptor.Import and call app.use
import { StandardResponseInterceptor } from '@infra-node-kit/interceptors';
const app = await NestFactory(AppModule);
...
app.use(new StandardResponseInterceptor());
await app.listen(3000);
@Controller('')
export class TestController {
@Get()
async test() {
return {
name: 'infra-node-kit'
}
}
}
the response will be:
{
data: {
name: 'infra-node-kit'
},
code: 0,
message: 'OK',
status: 200
}
@Controller('')
export class TestController {
@Get()
async ResPassthrough(@Res() res: Response) {
res.send({
name: 'infra-node-kit'
})
}
}
the response will be:
{
name: 'infra-node-kit'
}
GetStandardResponseInterceptor( options: IStandardResponseOptions )
interface IStandardResponseOptions {
skipPaths?: string[] // the path in the skipPaths will ignore wrapper
code?: number // the uniform code
message?: string // the uniform message
}
import { GetStandardResponseInterceptor } from '@infra-node-kit/interceptors';
const app = await NestFactory(AppModule);
...
const StandardResponseInterceptor = GetStandardResponseInterceptor({
skipPaths: ['/metrics'],
code: 1,
message: 'is success'
})
app.use(new StandardResponseInterceptor());
await app.listen(3000);
FAQs
NestJS provide a Interceptor concept. Interceptors have a set of useful capabilities which are inspired by the Aspect Oriented Programming (AOP) technique. This package function is to collect commonly used interceptor.
The npm package @redhare/interceptors receives a total of 0 weekly downloads. As such, @redhare/interceptors popularity was classified as not popular.
We found that @redhare/interceptors demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.