Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
nestjs-console
Advanced tools
NestJS Console is a module that provide a cli. A ready to use service class for your module that exposes the required methods to register commands and sub commands using the npm package commander
npm install nestjs-console
# or unig yarn
yarn install nestjs-console
Create a file next to main.ts named console.ts
Import your app module or any module you want to be loaded. Usually this is your main nestjs module.
import { bootstrap } from 'nestjs-console';
import { AppModule } from './bundles/app';
bootstrap(AppModule, { logger: false }).catch(e => console.log('Error', e));
Import the ConsoleModule inside your module
// module.ts
import { Module } from '@nestjs/common';
import { ConsoleModule } from 'nestjs-console';
import { MyService } from './service';
@Module({
imports: [
ConsoleModule // Import the module where you need it
],
exports: [MyService]
})
export class MyModule {}
You can now inject the ConsoleService inside any nestjs providers, controllers...
// service.ts
import { Injectable } from '@nestjs/common';
import { ConsoleService } from 'nestjs-console';
@Injectable()
export class MyService {
constructor(private readonly consoleService: ConsoleService) {
this.consoleService
.getCli()
.command('mycommand')
.options('-a, --all', 'an exemple of options')
.action(this.myCommand.bind(this));
}
myCommand(options) {
//See Ora npm package for details about spinner
const spin = this.consoleService.createSpinner();
spin.start();
// DO SOME WORK
spin.stop();
}
}
A typedoc is generated and available on github https://pop-code.github.io/nestjs-console
FAQs
A NestJS module that provide a cli
We found that nestjs-console demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.