Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Mux module that provides standardized setup and dependency injection in a Nest project for the Mux API client.
yarn add nestjs-mux
npm install nestjs-mux --save
Import and configure MuxModule
with Mux's access and secret tokens into the root module AppModule
.
import { Module } from '@nestjs/common';
import { MuxModule } from 'nestjs-mux';
@Module({
imports: [
MuxModule.forRoot({
id: idToken,
secret: secretToken,
}),
],
})
export default class AppModule {}
If you need to load the configuration options asynchronously you can use the following options:
import { Module } from '@nestjs/common';
import { MuxModule } from 'nestjs-mux';
import { ConfigModule } from './config/config.module';
import { ConfigService } from './config/config.service';
@Module({
imports: [
MuxModule.forRootAsync({
imports: [ConfigModule],
useFactory: (configService: ConfigService) => ({
id: configService.getString('MUX_ID_TOKEN'),
secret: configService.getString('MUX_SECRET_TOKEN'),
}),
inject: [ConfigService],
}),
],
})
export class AppModule {}
import { Module } from '@nestjs/common';
import { MuxModule } from 'nestjs-mux';
import { MuxConfigService } from './config/mux.config.service';
@Module({
imports: [
MuxModule.forRootAsync({
useClass: MuxConfigService,
}),
],
})
export class AppModule {}
import { Module } from '@nestjs/common';
import { MuxModule } from 'nestjs-mux';
import { ConfigModule } from './config/config.module';
import { ConfigService } from './config/mux.config.service';
@Module({
imports: [
MuxModule.forRootAsync({
imports: [ConfigModule],
useExisting: ConfigService,
}),
],
})
export class AppModule {}
You can then inject the Mux client into constructors with its decorator.
import * as Mux from '@mux/mux-node';
import { Injectable } from '@nestjs/common';
import { InjectMux } from 'nestjs-mux';
@Injectable()
export default class AppService {
public constructor(@InjectMux() private readonly muxClient: Mux) {}
}
FAQs
Mux module for NestJS.
The npm package nestjs-mux receives a total of 4 weekly downloads. As such, nestjs-mux popularity was classified as not popular.
We found that nestjs-mux 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.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.