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

npkill

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npkill - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

2

lib/controller.d.ts

@@ -40,2 +40,3 @@ import { ConsoleService } from './services/console.service';

private printFoldersSection;
private clearFolderSection;
private colorDeletedTextGreen;

@@ -54,2 +55,3 @@ private setupKeysListener;

private checkCursorScroll;
private scrollFolderResults;
private delete;

@@ -56,0 +58,0 @@ private deleteFolder;

31

lib/controller.js

@@ -227,3 +227,5 @@ "use strict";

// Folder size
const folderSizeText = folder.size ? folder.size + 'mb' : '--';
const folderSizeText = folder.size
? folder.size.toFixed(main_constants_1.DECIMALS_SIZE) + ' mb'
: '--';
this.printAt(folderSizeText, {

@@ -236,2 +238,7 @@ x: this.stdout.columns - main_constants_1.MARGINS.FOLDER_SIZE_COLUMN,

}
clearFolderSection() {
for (let row = main_constants_1.MARGINS.ROW_RESULTS_START; row < this.stdout.rows; row++) {
this.clearLine(row);
}
}
colorDeletedTextGreen(folderString) {

@@ -271,3 +278,3 @@ return folderString.replace(messages_constants_1.INFO_MSGS.DELETED_FOLDER, colors.green(messages_constants_1.INFO_MSGS.DELETED_FOLDER));

.then((size) => {
folder.size = +size;
folder.size = +size.toFixed(main_constants_1.DECIMALS_SIZE);
resolve(folder);

@@ -302,9 +309,11 @@ })

checkCursorScroll() {
if (this.cursorPosY < main_constants_1.MARGINS.ROW_RESULTS_START + this.scroll) {
this.scroll--;
}
if (this.cursorPosY > this.stdout.rows + this.scroll - 1) {
this.scroll++;
}
if (this.cursorPosY < main_constants_1.MARGINS.ROW_RESULTS_START + this.scroll)
this.scrollFolderResults(-1);
if (this.cursorPosY > this.stdout.rows + this.scroll - 1)
this.scrollFolderResults(1);
}
scrollFolderResults(scrollAmount) {
this.scroll += scrollAmount;
this.clearFolderSection();
}
delete() {

@@ -339,4 +348,6 @@ const nodeFolder = this.nodeFolders[this.cursorPosY - main_constants_1.MARGINS.ROW_RESULTS_START];

spaceReleasedPosition.x += messages_constants_1.INFO_MSGS.SPACE_RELEASED.length;
this.printAt(stats.totalSpace + ' mb', totalSpacePosition);
this.printAt(stats.spaceReleased + ' mb', spaceReleasedPosition);
const totalSpace = stats.totalSpace.toFixed(main_constants_1.DECIMALS_SIZE) + ' mb';
const spaceReleased = stats.spaceReleased.toFixed(main_constants_1.DECIMALS_SIZE) + ' mb';
this.printAt(totalSpace, totalSpacePosition);
this.printAt(spaceReleased, spaceReleasedPosition);
}

@@ -343,0 +354,0 @@ getStats() {

#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const controller_1 = require("./controller");
const console_service_1 = require("./services/console.service");
const controller_1 = require("./controller");
const files_service_1 = require("./services/files.service");
const spinner_service_1 = require("./services/spinner.service");
const controller = new controller_1.Controller(new console_service_1.ConsoleService(), new files_service_1.FileService(), new spinner_service_1.SpinnerService());

@@ -8,3 +8,2 @@ "use strict";

const rxjs_1 = require("rxjs");
const main_constants_1 = require("../constants/main.constants");
class FileService {

@@ -74,3 +73,3 @@ getFileContentSync(path) {

const factorBtoMb = 1048576;
return +(bytes / factorBtoMb).toFixed(main_constants_1.DECIMALS_SIZE);
return bytes / factorBtoMb;
}

@@ -77,0 +76,0 @@ getDirectoryFiles(dir) {

{
"name": "npkill",
"version": "0.1.3",
"version": "0.1.4",
"description": "This tool allows you to list any node_modules directories in your system, as well as the space they take up. You can then select which ones you want to erase to free up space.",

@@ -9,8 +9,2 @@ "main": "lib/index.js",

},
"scripts": {
"build": "tsc",
"start": "ts-node ./src/index.ts",
"test": "jest --config jestconfig.json",
"test:watch": "jest --config jestconfig.json --watch"
},
"bin": {

@@ -25,10 +19,19 @@ "npkill": "lib/index.js"

"license": "MIT",
"keywords": [
"cli",
"console",
"npm",
"node",
"module",
"clean",
"interactive"
],
"files": [
"lib/**/*"
],
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-commit": "lint-staged"
}
"scripts": {
"build": "tsc",
"start": "ts-node ./src/index.ts",
"test": "jest --config jestconfig.json",
"test:watch": "jest --config jestconfig.json --watch"
},

@@ -41,11 +44,11 @@ "dependencies": {

"node-emoji": "^1.10.0",
"remark-lint": "^6.0.5",
"rxjs": "^6.5.2",
"typescript": "^3.4.5"
"rxjs": "^6.5.2"
},
"devDependencies": {
"typescript": "^3.4.5",
"ts-node": "^8.3.0",
"commitlint": "^8.0.0",
"@commitlint/config-conventional": "^8.0.0",
"@types/jest": "^24.0.13",
"@types/node": "^12.0.0",
"commitlint": "^8.0.0",
"husky": "^2.7.0",

@@ -57,4 +60,10 @@ "jest": "^24.8.0",

"ts-jest": "^24.0.2",
"ts-node": "^8.3.0"
"remark-lint": "^6.0.5"
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-commit": "lint-staged"
}
},
"lint-staged": {

@@ -61,0 +70,0 @@ "*.{js,ts,css,json,md}": [

@@ -7,2 +7,3 @@ <p align="center">

<img alt="npm" src="https://img.shields.io/npm/dy/npkill.svg">
<a href="https://www.codacy.com/app/zaldih/npkill?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=zaldih/npkill&amp;utm_campaign=Badge_Grade"><img src="https://api.codacy.com/project/badge/Grade/b8ba5eb6cba4413eb474921dcc460f34"/></a>
<img alt="npm version" src="https://img.shields.io/npm/v/npkill.svg">

@@ -9,0 +10,0 @@ <!-- <img alt="npm bundle size" src="https://img.shields.io/bundlephobia/min/npkill.svg"> -->

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