window-cleaner 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -0
- package/dist/src/cleaner.d.ts +1 -0
- package/dist/src/cleaner.js +34 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +5 -0
- package/package.json +22 -0
package/README.md
ADDED
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function clean(): void;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.clean = clean;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const os_1 = __importDefault(require("os"));
|
|
10
|
+
function cleanFolder(folderPath) {
|
|
11
|
+
if (!fs_1.default.existsSync(folderPath))
|
|
12
|
+
return;
|
|
13
|
+
const files = fs_1.default.readdirSync(folderPath);
|
|
14
|
+
for (const file of files) {
|
|
15
|
+
const fullPath = path_1.default.join(folderPath, file);
|
|
16
|
+
try {
|
|
17
|
+
fs_1.default.rmSync(fullPath, {
|
|
18
|
+
recursive: true,
|
|
19
|
+
force: true,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
console.log("Skipped:", fullPath);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function clean() {
|
|
28
|
+
const paths = [os_1.default.tmpdir(), "C:\\Windows\\Temp", "C:\\Windows\\Prefetch"];
|
|
29
|
+
for (const p of paths) {
|
|
30
|
+
console.log(`Cleaning: ${p}`);
|
|
31
|
+
cleanFolder(p);
|
|
32
|
+
}
|
|
33
|
+
console.log("Cleaning finished ✅");
|
|
34
|
+
}
|
package/dist/src/cli.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "window-cleaner",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"main": "dist/cleaner.js",
|
|
5
|
+
"bin": "dist/cli.js",
|
|
6
|
+
"files": ["dist"],
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc"
|
|
9
|
+
},
|
|
10
|
+
"keywords": ["temp" , "cleaner", "windows", "cli"],
|
|
11
|
+
"author": "sandesh",
|
|
12
|
+
"license": "ISC",
|
|
13
|
+
"description": "Clean up your windows temporary files and folders",
|
|
14
|
+
"repository": {
|
|
15
|
+
"url": "https://github.com/sthaSandesh/Window-Cleaner",
|
|
16
|
+
"type": "git"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@types/node": "^25.0.9",
|
|
20
|
+
"typescript": "^5.9.3"
|
|
21
|
+
}
|
|
22
|
+
}
|