New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nestjs-console

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nestjs-console - npm Package Compare versions

Comparing version 8.0.0 to 9.0.0

13

CHANGELOG.md

@@ -7,2 +7,12 @@ # Changelog

## [9.0.0] - 2023-07-15
### Changed
- Support nestjs v10
- Support commander v11
- Update dependencies
- Remove Ora from dependencies and helpers
- Revert node engine in the runtime requirements to minimum version node v16 (required by commander v11)
## [8.0.0] - 2022-07-28

@@ -248,3 +258,4 @@

[unreleased]: https://github.com/Pop-Code/nestjs-console/compare/v8.0.0...HEAD
[unreleased]: https://github.com/Pop-Code/nestjs-console/compare/v9.0.0...HEAD
[9.0.0]: https://github.com/Pop-Code/nestjs-console/compare/v8.0.0...v9.0.0
[8.0.0]: https://github.com/Pop-Code/nestjs-console/compare/v7.0.1...v8.0.0

@@ -251,0 +262,0 @@ [7.0.1]: https://github.com/Pop-Code/nestjs-console/compare/v7.0.0...v7.0.1

4

dist/decorators.d.ts

@@ -1,2 +0,2 @@

export declare type ParserType = (value: string, previous: any) => any;
export type ParserType = (value: string, previous: any) => any;
export declare const InjectCli: () => ParameterDecorator;

@@ -17,3 +17,3 @@ export interface CommandOption {

export declare const Command: (options: CreateCommandOptions) => MethodDecorator;
export declare const Console: (options?: CreateCommandOptions | undefined) => ClassDecorator;
export declare const Console: (options?: CreateCommandOptions) => ClassDecorator;
//# sourceMappingURL=decorators.d.ts.map

@@ -5,3 +5,2 @@ export * from './bootstrap/abstract';

export * from './decorators';
export * from './helpers';
export * from './module';

@@ -8,0 +7,0 @@ export * from './scanner';

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -17,3 +21,2 @@ if (k2 === undefined) k2 = k;

__exportStar(require("./decorators"), exports);
__exportStar(require("./helpers"), exports);
__exportStar(require("./module"), exports);

@@ -20,0 +23,0 @@ __exportStar(require("./scanner"), exports);

import * as commander from 'commander';
export declare type CommandActionHandler = ((...args: any[]) => any | Promise<any>) | {
export type CommandActionHandler = ((...args: any[]) => any | Promise<any>) | {
instance: any;
methodName: string;
};
export declare type CommandActionWrapper = (...args: any[]) => Promise<CommandResponse>;
export type CommandActionWrapper = (...args: any[]) => Promise<CommandResponse>;
export interface CommandResponse {

@@ -8,0 +8,0 @@ data: any;

@@ -30,3 +30,3 @@ "use strict";

};
let ConsoleModule = class ConsoleModule {
let ConsoleModule = exports.ConsoleModule = class ConsoleModule {
constructor(service) {

@@ -66,3 +66,3 @@ this.service = service;

};
ConsoleModule = __decorate([
exports.ConsoleModule = ConsoleModule = __decorate([
(0, common_1.Module)({

@@ -74,3 +74,2 @@ providers: [cliProvider, service_1.ConsoleService],

], ConsoleModule);
exports.ConsoleModule = ConsoleModule;
//# sourceMappingURL=module.js.map

@@ -0,1 +1,2 @@

/// <reference types="node" />
import { INestApplicationContext } from '@nestjs/common';

@@ -5,2 +6,3 @@ import * as commander from 'commander';

import { CommandActionHandler, CommandActionWrapper, CommandResponse } from './interfaces';
import { EventEmitter } from 'stream';
export declare class ConsoleService {

@@ -10,2 +12,3 @@ protected container?: INestApplicationContext;

protected cli: commander.Command;
protected responseListener: EventEmitter;
constructor(cli: commander.Command);

@@ -12,0 +15,0 @@ static createCli(name?: string): commander.Command;

@@ -29,5 +29,8 @@ "use strict";

const decorators_1 = require("./decorators");
let ConsoleService = ConsoleService_1 = class ConsoleService {
const stream_1 = require("stream");
let ConsoleService = exports.ConsoleService = ConsoleService_1 = class ConsoleService {
;
constructor(cli) {
this.commands = new Map();
this.responseListener = new stream_1.EventEmitter();
this.cli = cli;

@@ -83,3 +86,11 @@ }

const userArgs = this.cli._prepareUserArgs(argv);
return yield this.cli._parseCommand([], userArgs);
return new Promise((resolve, reject) => {
this.responseListener.once('response', (res) => {
resolve(res);
});
this.responseListener.once('error', (error) => {
reject(error);
});
this.cli._parseCommand([], userArgs);
});
});

@@ -109,5 +120,14 @@ }

}
command.action(ConsoleService_1.createHandler(handler));
command.action((...args) => __awaiter(this, void 0, void 0, function* () {
try {
const res = yield ConsoleService_1.createHandler(handler)(...args);
this.responseListener.emit('response', res);
}
catch (e) {
this.responseListener.emit('error', e);
}
}));
parent.addCommand(command, commanderOptions);
this.commands.set(this.getCommandFullName(command), command);
command.on('response', (res) => { });
return command;

@@ -150,3 +170,3 @@ }

};
ConsoleService = ConsoleService_1 = __decorate([
exports.ConsoleService = ConsoleService = ConsoleService_1 = __decorate([
(0, common_1.Injectable)(),

@@ -156,3 +176,2 @@ __param(0, (0, decorators_1.InjectCli)()),

], ConsoleService);
exports.ConsoleService = ConsoleService;
//# sourceMappingURL=service.js.map
{
"name": "nestjs-console",
"version": "8.0.0",
"version": "9.0.0",
"description": "A NestJS module that provide a cli",

@@ -19,32 +19,31 @@ "keywords": [

"peerDependencies": {
"@nestjs/common": "^9",
"@nestjs/core": "^9"
"@nestjs/common": "^9.0.0 || ^10.0.0",
"@nestjs/core": "^9.0.0 || ^10.0.0"
},
"dependencies": {
"ora": "5.4.1",
"commander": "^8.1.0"
"commander": "^11.0.0"
},
"devDependencies": {
"@nestjs/common": "9.0.5",
"@nestjs/core": "9.0.5",
"@nestjs/platform-express": "9.0.5",
"@nestjs/testing": "9.0.5",
"@types/jest": "27.0.3",
"@types/node": "16.11.10",
"@typescript-eslint/eslint-plugin": "5.4.0",
"@typescript-eslint/parser": "5.4.0",
"@nestjs/common": "10.0.5",
"@nestjs/core": "10.0.5",
"@nestjs/platform-express": "10.0.5",
"@nestjs/testing": "10.0.5",
"@types/jest": "29.5.3",
"@types/node": "20.4.2",
"@typescript-eslint/eslint-plugin": "6.0.0",
"@typescript-eslint/parser": "6.0.0",
"codecov": "3.8.3",
"eslint": "8.3.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-import": "2.25.3",
"eslint": "8.45.0",
"eslint-config-prettier": "8.8.0",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-prefer-arrow": "1.2.3",
"jest": "27.3.1",
"prettier": "2.4.1",
"jest": "29.6.1",
"prettier": "3.0.0",
"reflect-metadata": "0.1.13",
"rxjs": "7.4.0",
"ts-jest": "27.0.7",
"ts-node": "10.4.0",
"tsconfig-paths": "3.12.0",
"typedoc": "0.22.10",
"typescript": "4.5.2"
"rxjs": "7.8.1",
"ts-jest": "29.1.1",
"ts-node": "10.9.1",
"tsconfig-paths": "4.2.0",
"typedoc": "0.24.8",
"typescript": "5.1.6"
},

@@ -82,3 +81,6 @@ "scripts": {

"coverageDirectory": "./coverage"
},
"engines": {
"node": ">=16.0.0"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc