binary-collections 2.0.5 → 2.0.7

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.
Files changed (126) hide show
  1. package/bin/bash-dummy +7 -2
  2. package/bin/clean-nodemodule +7 -2
  3. package/bin/clean-nodemodules +7 -2
  4. package/bin/dev +7 -2
  5. package/bin/empty +7 -2
  6. package/bin/git-diff.cmd +4 -0
  7. package/bin/git-fix-encoding +7 -2
  8. package/bin/git-fix-encoding.cmd +0 -0
  9. package/bin/git-reduce-size +7 -2
  10. package/bin/kill-process +7 -2
  11. package/bin/nodekill +7 -2
  12. package/bin/nodekill.cmd +0 -0
  13. package/bin/nodekill.ps1 +0 -0
  14. package/bin/prod +7 -2
  15. package/bin/rmfind +7 -2
  16. package/bin/rmpath +7 -2
  17. package/bin/rmx +9 -3
  18. package/bin/submodule +13 -2
  19. package/bin/submodule-install +7 -2
  20. package/bin/submodule-remove +7 -2
  21. package/lib/chunk-3LOB2P54.mjs +202 -0
  22. package/lib/chunk-4LEXWIIF.mjs +173 -0
  23. package/lib/chunk-BSD5CIRU.mjs +52 -0
  24. package/lib/chunk-FB6YIQYR.mjs +42 -0
  25. package/lib/chunk-JL32QDSH.mjs +20 -0
  26. package/lib/chunk-OKYLF2MU.mjs +53 -0
  27. package/lib/chunk-VXZQNLPU.mjs +23 -0
  28. package/lib/del-gradle.cjs +72 -0
  29. package/lib/del-gradle.d.mts +2 -0
  30. package/lib/del-gradle.d.ts +1 -0
  31. package/lib/del-gradle.js +15 -0
  32. package/lib/del-gradle.mjs +28 -0
  33. package/lib/del-node-modules.cjs +72 -0
  34. package/lib/del-node-modules.d.mts +2 -0
  35. package/lib/del-node-modules.d.ts +1 -0
  36. package/lib/del-node-modules.js +11 -15
  37. package/lib/del-node-modules.mjs +28 -0
  38. package/lib/del-ps.cjs +93 -0
  39. package/lib/del-ps.d.mts +2 -0
  40. package/lib/del-ps.d.ts +1 -0
  41. package/lib/del-ps.js +31 -0
  42. package/lib/del-ps.mjs +43 -0
  43. package/lib/del-yarn-caches.cjs +65 -0
  44. package/lib/del-yarn-caches.d.mts +2 -0
  45. package/lib/del-yarn-caches.d.ts +1 -0
  46. package/lib/del-yarn-caches.js +6 -9
  47. package/lib/del-yarn-caches.mjs +21 -0
  48. package/lib/find-node-modules-cli.cjs +59 -0
  49. package/lib/find-node-modules-cli.d.mts +1 -0
  50. package/lib/find-node-modules-cli.d.ts +2 -0
  51. package/lib/find-node-modules-cli.js +3 -0
  52. package/lib/find-node-modules-cli.mjs +14 -0
  53. package/lib/find-node-modules.cjs +34 -0
  54. package/lib/find-node-modules.d.mts +10 -0
  55. package/lib/find-node-modules.d.ts +9 -0
  56. package/lib/find-node-modules.js +41 -13
  57. package/lib/find-node-modules.mjs +7 -0
  58. package/lib/git-diff.cjs +74 -0
  59. package/lib/git-diff.d.cts +2 -0
  60. package/lib/git-diff.d.mts +87 -0
  61. package/lib/git-diff.d.ts +87 -0
  62. package/lib/git-diff.mjs +83 -0
  63. package/lib/git-purge.cjs +91 -0
  64. package/lib/git-purge.d.mts +2 -0
  65. package/lib/git-purge.d.ts +1 -0
  66. package/lib/git-purge.js +59 -0
  67. package/lib/git-purge.mjs +47 -0
  68. package/lib/index.cjs +92 -0
  69. package/lib/index.d.mts +1 -0
  70. package/lib/index.d.ts +2 -0
  71. package/lib/index.js +8 -0
  72. package/lib/index.mjs +18 -0
  73. package/lib/npm-run-series.cjs +61 -0
  74. package/lib/npm-run-series.d.mts +1 -0
  75. package/lib/npm-run-series.d.ts +2 -0
  76. package/lib/npm-run-series.js +80 -39
  77. package/lib/npm-run-series.mjs +47 -0
  78. package/lib/package-resolutions.cjs +28 -0
  79. package/lib/package-resolutions.d.mts +25 -0
  80. package/lib/package-resolutions.d.ts +25 -0
  81. package/lib/package-resolutions.mjs +31 -0
  82. package/lib/ps/connected-domain.cjs +156 -0
  83. package/lib/ps/connected-domain.d.mts +3 -0
  84. package/lib/ps/connected-domain.d.ts +2 -0
  85. package/lib/ps/connected-domain.js +202 -0
  86. package/lib/ps/connected-domain.mjs +7 -0
  87. package/lib/ps/index.cjs +555 -0
  88. package/lib/ps/index.d.cjs +17 -0
  89. package/lib/ps/index.d.d.mts +26 -0
  90. package/lib/ps/index.d.d.ts +26 -0
  91. package/lib/ps/index.d.mjs +8 -0
  92. package/lib/ps/index.d.mts +26 -0
  93. package/lib/ps/index.d.ts +2 -0
  94. package/lib/ps/index.js +250 -0
  95. package/lib/ps/index.mjs +203 -0
  96. package/lib/ps/isWin.cjs +3 -0
  97. package/lib/ps/isWin.d.mts +3 -0
  98. package/lib/ps/isWin.d.ts +2 -0
  99. package/lib/ps/isWin.js +2 -0
  100. package/lib/ps/isWin.mjs +7 -0
  101. package/lib/ps/table-parser.cjs +359 -0
  102. package/lib/ps/table-parser.d.mts +3 -0
  103. package/lib/ps/table-parser.d.ts +1 -0
  104. package/lib/ps/table-parser.js +268 -0
  105. package/lib/ps/table-parser.mjs +8 -0
  106. package/lib/submodule-install.cjs +118 -0
  107. package/lib/submodule-install.d.cts +2 -0
  108. package/lib/submodule-install.d.mts +141 -0
  109. package/lib/submodule-install.d.ts +141 -0
  110. package/lib/submodule-install.mjs +116 -0
  111. package/lib/utils.cjs +35 -0
  112. package/lib/utils.d.mts +20 -0
  113. package/lib/utils.d.ts +16 -0
  114. package/lib/utils.js +42 -28
  115. package/lib/utils.mjs +7 -0
  116. package/lib/yarn-reinstall.cjs +42 -0
  117. package/lib/yarn-reinstall.d.cts +1 -0
  118. package/lib/yarn-reinstall.d.mts +45 -0
  119. package/lib/yarn-reinstall.d.ts +45 -0
  120. package/lib/yarn-reinstall.mjs +50 -0
  121. package/package.json +80 -38
  122. package/readme.md +188 -40
  123. package/src/ps/index.js +285 -0
  124. package/test/package.json +19 -0
  125. package/index.js +0 -1
  126. package/lib/package-resolutions.json +0 -22
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ const { execSync } = require("child_process");
3
+ const args = process.argv.slice(2);
4
+ if (args.length === 0) {
5
+ console.error("Usage: yarn-reinstall <packageName> [--dev|-D|--peer|-P|--optional|-O]");
6
+ process.exit(1);
7
+ }
8
+ // Extract package name and flags
9
+ const pkgIndex = args.findIndex((arg) => !arg.startsWith("-"));
10
+ if (pkgIndex === -1) {
11
+ console.error("Please provide a package name.");
12
+ process.exit(1);
13
+ }
14
+ const packageName = args[pkgIndex];
15
+ const flags = args.slice(pkgIndex + 1);
16
+ // Remove and add commands
17
+ const removeCmd = `yarn remove ${packageName}`;
18
+ const addCmd = `yarn add ${packageName} ${flags.join(" ")}`.trim();
19
+ try {
20
+ // Check if the package is installed before removing
21
+ let isInstalled = false;
22
+ try {
23
+ const listOutput = execSync(`yarn list --pattern "${packageName}" --depth=0`, { encoding: "utf8" });
24
+ isInstalled = listOutput.includes(packageName + "@");
25
+ }
26
+ catch (_e) {
27
+ // If yarn list fails, assume not installed
28
+ isInstalled = false;
29
+ }
30
+ if (isInstalled) {
31
+ console.log(`Running: ${removeCmd}`);
32
+ execSync(removeCmd, { stdio: "inherit" });
33
+ }
34
+ else {
35
+ console.warn(`Package "${packageName}" was not installed or not referenced, skipping remove.`);
36
+ }
37
+ console.log(`Running: ${addCmd}`);
38
+ execSync(addCmd, { stdio: "inherit" });
39
+ }
40
+ catch (err) {
41
+ process.exit(err.status || 1);
42
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,45 @@
1
+ const { execSync } = require("child_process");
2
+
3
+ const args = process.argv.slice(2);
4
+
5
+ if (args.length === 0) {
6
+ console.error("Usage: yarn-reinstall <packageName> [--dev|-D|--peer|-P|--optional|-O]");
7
+ process.exit(1);
8
+ }
9
+
10
+ // Extract package name and flags
11
+ const pkgIndex = args.findIndex((arg) => !arg.startsWith("-"));
12
+ if (pkgIndex === -1) {
13
+ console.error("Please provide a package name.");
14
+ process.exit(1);
15
+ }
16
+ const packageName = args[pkgIndex];
17
+ const flags = args.slice(pkgIndex + 1);
18
+
19
+ // Remove and add commands
20
+ const removeCmd = `yarn remove ${packageName}`;
21
+ const addCmd = `yarn add ${packageName} ${flags.join(" ")}`.trim();
22
+
23
+ try {
24
+ // Check if the package is installed before removing
25
+ let isInstalled = false;
26
+ try {
27
+ const listOutput = execSync(`yarn list --pattern "${packageName}" --depth=0`, { encoding: "utf8" });
28
+ isInstalled = listOutput.includes(packageName + "@");
29
+ } catch (_e) {
30
+ // If yarn list fails, assume not installed
31
+ isInstalled = false;
32
+ }
33
+
34
+ if (isInstalled) {
35
+ console.log(`Running: ${removeCmd}`);
36
+ execSync(removeCmd, { stdio: "inherit" });
37
+ } else {
38
+ console.warn(`Package "${packageName}" was not installed or not referenced, skipping remove.`);
39
+ }
40
+
41
+ console.log(`Running: ${addCmd}`);
42
+ execSync(addCmd, { stdio: "inherit" });
43
+ } catch (err) {
44
+ process.exit(err.status || 1);
45
+ }
@@ -0,0 +1,45 @@
1
+ const { execSync } = require("child_process");
2
+
3
+ const args = process.argv.slice(2);
4
+
5
+ if (args.length === 0) {
6
+ console.error("Usage: yarn-reinstall <packageName> [--dev|-D|--peer|-P|--optional|-O]");
7
+ process.exit(1);
8
+ }
9
+
10
+ // Extract package name and flags
11
+ const pkgIndex = args.findIndex((arg) => !arg.startsWith("-"));
12
+ if (pkgIndex === -1) {
13
+ console.error("Please provide a package name.");
14
+ process.exit(1);
15
+ }
16
+ const packageName = args[pkgIndex];
17
+ const flags = args.slice(pkgIndex + 1);
18
+
19
+ // Remove and add commands
20
+ const removeCmd = `yarn remove ${packageName}`;
21
+ const addCmd = `yarn add ${packageName} ${flags.join(" ")}`.trim();
22
+
23
+ try {
24
+ // Check if the package is installed before removing
25
+ let isInstalled = false;
26
+ try {
27
+ const listOutput = execSync(`yarn list --pattern "${packageName}" --depth=0`, { encoding: "utf8" });
28
+ isInstalled = listOutput.includes(packageName + "@");
29
+ } catch (_e) {
30
+ // If yarn list fails, assume not installed
31
+ isInstalled = false;
32
+ }
33
+
34
+ if (isInstalled) {
35
+ console.log(`Running: ${removeCmd}`);
36
+ execSync(removeCmd, { stdio: "inherit" });
37
+ } else {
38
+ console.warn(`Package "${packageName}" was not installed or not referenced, skipping remove.`);
39
+ }
40
+
41
+ console.log(`Running: ${addCmd}`);
42
+ execSync(addCmd, { stdio: "inherit" });
43
+ } catch (err) {
44
+ process.exit(err.status || 1);
45
+ }
@@ -0,0 +1,50 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import {
3
+ init_esm_shims
4
+ } from "./chunk-VXZQNLPU.mjs";
5
+ import {
6
+ __commonJS,
7
+ __require
8
+ } from "./chunk-FB6YIQYR.mjs";
9
+
10
+ // src/yarn-reinstall.cjs
11
+ var require_yarn_reinstall = __commonJS({
12
+ "src/yarn-reinstall.cjs"() {
13
+ init_esm_shims();
14
+ var { execSync } = __require("child_process");
15
+ var args = process.argv.slice(2);
16
+ if (args.length === 0) {
17
+ console.error("Usage: yarn-reinstall <packageName> [--dev|-D|--peer|-P|--optional|-O]");
18
+ process.exit(1);
19
+ }
20
+ var pkgIndex = args.findIndex((arg) => !arg.startsWith("-"));
21
+ if (pkgIndex === -1) {
22
+ console.error("Please provide a package name.");
23
+ process.exit(1);
24
+ }
25
+ var packageName = args[pkgIndex];
26
+ var flags = args.slice(pkgIndex + 1);
27
+ var removeCmd = `yarn remove ${packageName}`;
28
+ var addCmd = `yarn add ${packageName} ${flags.join(" ")}`.trim();
29
+ try {
30
+ let isInstalled = false;
31
+ try {
32
+ const listOutput = execSync(`yarn list --pattern "${packageName}" --depth=0`, { encoding: "utf8" });
33
+ isInstalled = listOutput.includes(packageName + "@");
34
+ } catch (_e) {
35
+ isInstalled = false;
36
+ }
37
+ if (isInstalled) {
38
+ console.log(`Running: ${removeCmd}`);
39
+ execSync(removeCmd, { stdio: "inherit" });
40
+ } else {
41
+ console.warn(`Package "${packageName}" was not installed or not referenced, skipping remove.`);
42
+ }
43
+ console.log(`Running: ${addCmd}`);
44
+ execSync(addCmd, { stdio: "inherit" });
45
+ } catch (err) {
46
+ process.exit(err.status || 1);
47
+ }
48
+ }
49
+ });
50
+ export default require_yarn_reinstall();
package/package.json CHANGED
@@ -1,27 +1,49 @@
1
1
  {
2
2
  "name": "binary-collections",
3
- "version": "2.0.5",
4
- "description": "binary helper collections by L3n4r0x",
5
- "main": "index.js",
3
+ "version": "2.0.7",
4
+ "description": "Utility to clean any programming caches and more",
5
+ "main": "lib/index.js",
6
+ "types": "lib/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "require": {
10
+ "default": "./lib/index.cjs",
11
+ "types": "./lib/index.d.ts"
12
+ },
13
+ "import": {
14
+ "default": "./lib/index.mjs",
15
+ "types": "./lib/index.d.mts"
16
+ }
17
+ }
18
+ },
6
19
  "files": [
7
20
  "bin",
8
21
  "lib",
9
22
  "index.js",
10
- "!releases"
23
+ "!test",
24
+ "package.json"
11
25
  ],
12
26
  "directories": {
13
27
  "lib": "lib",
14
- "test": "test"
28
+ "bin": "bin"
15
29
  },
16
30
  "scripts": {
17
31
  "update:packer": "curl -L https://github.com/dimaslanjaka/nodejs-package-types/raw/main/packer.js > packer.js",
18
- "build": "node -r ts-node/register -r dotenv/config build.js && yarn run pack",
19
- "test": "cd test && npm install -D file:../ &&",
32
+ "build": "node build.tsup.js && tsc -b tsconfig.build.json && npm run postbuild",
33
+ "postbuild": "node -r ts-node/register -r dotenv/config build.js && yarn run pack",
34
+ "test": "jest",
35
+ "test:watch": "jest --watch",
36
+ "test:coverage": "jest --coverage",
20
37
  "test:nrs": "npm test -- nrs build:**",
21
38
  "pack": "node packer.js --yarn --filename=bin",
22
- "update:ncu": "npx npm-check-updates -u -x jsdom,chalk,hexo,deepmerge-ts --enginesNode --root"
39
+ "update:ncu": "npx npm-check-updates -u -x jsdom,chalk,hexo,deepmerge-ts --enginesNode --root",
40
+ "clean": "rimraf lib"
23
41
  },
24
- "keywords": [],
42
+ "keywords": [
43
+ "cache",
44
+ "cleaner",
45
+ "utility"
46
+ ],
25
47
  "author": {
26
48
  "email": "dimaslanjaka@gmail.com",
27
49
  "name": "dimaslanjaka",
@@ -37,33 +59,44 @@
37
59
  "homepage": "https://www.webmanajemen.com/",
38
60
  "license": "MIT",
39
61
  "dependencies": {
40
- "execa": "^8.0.1",
62
+ "dotenv": "^16.4.5",
63
+ "execa": "^9.4.0",
41
64
  "fs-extra": "^11.2.0",
42
- "glob": "^10.3.10",
43
- "minimatch": "^9.0.3",
65
+ "glob": "^11.0.0",
66
+ "minimatch": "^10.0.1",
44
67
  "minimist": "^1.2.8",
45
- "sbg-utility": "^1.1.6",
68
+ "ps-node": "^0.1.6",
69
+ "remove": "^0.1.5",
70
+ "sbg-utility": "^1.1.8",
46
71
  "upath": "^2.0.1",
47
- "yaml": "^2.3.4"
72
+ "yaml": "^2.5.1",
73
+ "yarn": "^1.22.22"
48
74
  },
49
- "packageManager": "yarn@3.6.1",
75
+ "packageManager": "yarn@4.9.2",
50
76
  "devDependencies": {
51
- "@types/eslint": "^8",
77
+ "@types/eslint": "^9",
78
+ "@types/fs-extra": "^11.0.4",
79
+ "@types/jest": "^30.0.0",
52
80
  "@types/minimist": "^1",
53
- "@types/node": "^20.11.16",
81
+ "@types/node": "^22.7.4",
54
82
  "@types/prettier": "^3",
83
+ "@types/ps-node": "^0",
55
84
  "@types/yargs": "^17",
56
- "@typescript-eslint/eslint-plugin": "^6.20.0",
57
- "@typescript-eslint/parser": "^6.20.0",
58
- "cross-spawn": "https://github.com/dimaslanjaka/node-cross-spawn/raw/ff4b648/release/cross-spawn.tgz",
59
- "dotenv": "^16.4.1",
60
- "eslint": "^8.56.0",
85
+ "@typescript-eslint/eslint-plugin": "^8.8.0",
86
+ "@typescript-eslint/parser": "^8.8.0",
87
+ "cross-spawn": "https://github.com/dimaslanjaka/node-cross-spawn/raw/private/release/cross-spawn.tgz",
88
+ "eslint": "^9.11.1",
61
89
  "eslint-config-prettier": "^9.1.0",
62
- "eslint-plugin-prettier": "^5.1.3",
90
+ "eslint-plugin-prettier": "^5.2.1",
63
91
  "git-command-helper": "^2.0.2",
64
- "prettier": "^3.2.4",
92
+ "globals": "^15.10.0",
93
+ "jest": "^30.0.4",
94
+ "prettier": "^3.3.3",
95
+ "rimraf": "^6.0.1",
96
+ "ts-jest": "^29.4.0",
65
97
  "ts-node": "^10.9.2",
66
- "typescript": "^5.3.3"
98
+ "tsup": "^8.3.0",
99
+ "typescript": "^5.6.2"
67
100
  },
68
101
  "optionalDependencies": {
69
102
  "ansi-colors": "^4.1.3"
@@ -71,30 +104,39 @@
71
104
  "bin": {
72
105
  "clean-nodemodule": "bin/clean-nodemodule",
73
106
  "clean-nodemodules": "bin/clean-nodemodules",
74
- "del-nodemodules": "lib/del-node-modules.js",
75
- "del-yarncaches": "lib/del-yarn-caches.js",
107
+ "del-gradle": "lib/del-gradle.cjs",
108
+ "del-node-modules": "lib/del-node-modules.cjs",
109
+ "del-nodemodules": "lib/del-node-modules.cjs",
110
+ "del-ps": "lib/del-ps.cjs",
111
+ "del-yarn-caches": "lib/del-yarn-caches.cjs",
112
+ "del-yarncaches": "lib/del-yarn-caches.cjs",
76
113
  "dev": "bin/dev",
77
114
  "empty": "bin/empty",
78
- "find-nodemodules": "lib/find-node-modules.js",
115
+ "find-node-modules": "lib/find-node-modules.cjs",
116
+ "find-node-modules-cli": "lib/find-node-modules-cli.cjs",
117
+ "find-nodemodules": "lib/find-node-modules-cli.cjs",
118
+ "git-diff": "lib/git-diff.cjs",
79
119
  "git-fix-encoding": "bin/git-fix-encoding",
80
- "git-fix-encoding-cmd": "bin/git-fix-encoding.cmd",
120
+ "git-purge": "lib/git-purge.cjs",
81
121
  "git-reduce-size": "bin/git-reduce-size",
82
- "javakill-cmd": "bin/javakill.cmd",
122
+ "index": "lib/index.cjs",
123
+ "javakill": "bin/javakill.cmd",
83
124
  "kill-process": "bin/kill-process",
84
125
  "nodekill": "bin/nodekill",
85
- "nodekill-cmd": "bin/nodekill.cmd",
86
- "nodekill-ps1": "bin/nodekill.ps1",
87
- "npm-run-series": "lib/npm-run-series.js",
88
- "nrs": "lib/npm-run-series.js",
126
+ "npm-run-series": "lib/npm-run-series.cjs",
127
+ "nrs": "lib/npm-run-series.cjs",
128
+ "package-resolutions": "lib/package-resolutions.cjs",
89
129
  "prod": "bin/prod",
90
130
  "rmfind": "bin/rmfind",
91
131
  "rmpath": "bin/rmpath",
92
132
  "rmx": "bin/rmx",
93
- "run-s": "lib/npm-run-series.js",
94
- "run-series": "lib/npm-run-series.js",
133
+ "run-s": "lib/npm-run-series.cjs",
134
+ "run-series": "lib/npm-run-series.cjs",
95
135
  "submodule": "bin/submodule",
96
- "submodule-install": "bin/submodule-install",
136
+ "submodule-install": "lib/submodule-install.cjs",
97
137
  "submodule-remove": "bin/submodule-remove",
98
- "submodule-token": "bin/submodule-token"
138
+ "submodule-token": "bin/submodule-token",
139
+ "utils": "lib/utils.cjs",
140
+ "yarn-reinstall": "lib/yarn-reinstall.cjs"
99
141
  }
100
142
  }
package/readme.md CHANGED
@@ -1,24 +1,40 @@
1
- # binary helper collections
2
- binary helper collections by L3n4r0x
1
+ # Binary Collections
3
2
 
4
- ## installation
3
+ A comprehensive collection of Node.js CLI tools designed to streamline common development workflows. This toolkit provides utilities for git operations, dependency management, build processes, and various development automation tasks.
5
4
 
6
- clone direct folder
5
+ ## Features
6
+
7
+ - 🧹 **Cleanup Tools**: Remove node_modules, yarn caches, gradle builds
8
+ - 🔄 **Git Utilities**: Submodule management, repository purging, diff tools
9
+ - 📦 **Build Tools**: NPM script runners, package management utilities
10
+ - ⚡ **Development Helpers**: Process management, environment setup tools
11
+
12
+ ## Installation
13
+
14
+ ### Clone Repository
7
15
  ```bash
8
16
  git clone -b master https://github.com/dimaslanjaka/bin bin
9
17
  ```
10
18
 
11
- via npm
19
+ ### NPM Installation
12
20
  ```bash
21
+ # Install locally
13
22
  npm install binary-collections
14
- # or
23
+
24
+ # Install globally
25
+ npm install binary-collections -g
26
+
27
+ # Install from Git
15
28
  npm install binary-collections@git+https://github.com/dimaslanjaka/bin.git
16
- # or
29
+
30
+ # Install from release archive
17
31
  npm install binary-collections@https://github.com/dimaslanjaka/bin/raw/master/releases/bin.tgz
18
32
  ```
19
33
 
20
- ## Setup vscode
21
- create `.vscode/settings.json`
34
+ ## VS Code Setup
35
+
36
+ Create `.vscode/settings.json` to add binary tools to your PATH:
37
+
22
38
  ```jsonc
23
39
  {
24
40
  "terminal.integrated.env.linux": {
@@ -45,36 +61,93 @@ create `.vscode/settings.json`
45
61
  },
46
62
  "Cygwin": {
47
63
  "path": "C:\\cygwin64\\bin\\bash.exe",
48
- "args": [
49
- "--login",
50
- "-i"
51
- ],
64
+ "args": ["--login", "-i"],
52
65
  "env": {
53
66
  "CHERE_INVOKING": "1"
54
67
  }
55
68
  }
56
69
  },
57
- "terminal.integrated.defaultProfile.windows": "Command Prompt",
70
+ "terminal.integrated.defaultProfile.windows": "Command Prompt"
58
71
  }
59
72
  ```
60
73
 
61
- ## Usages
74
+ ## Available Tools
75
+
76
+ ### Quick Reference
77
+
78
+ | Category | Tools | Description |
79
+ |----------|-------|-------------|
80
+ | **Git** | `git-purge`, `git-diff`, `git-fix-encoding`, `git-reduce-size` | Git repository management and optimization |
81
+ | **Submodules** | `submodule`, `submodule-install`, `submodule-remove`, `submodule-token` | Git submodule operations |
82
+ | **NPM Scripts** | `nrs`, `run-s`, `run-series`, `npm-run-series` | Run npm scripts in series with pattern matching |
83
+ | **Package Mgmt** | `yarn-reinstall`, `package-resolutions` | Yarn package management utilities |
84
+ | **Node.js Dev** | `find-node-modules`, `find-nodemodules`, `dev`, `prod`, `empty` | Node.js development helpers |
85
+ | **Process Mgmt** | `kill-process`, `nodekill`, `javakill`, `del-ps` | Process management and termination |
86
+ | **File System** | `rmfind`, `rmpath`, `rmx` | File system operations |
87
+ | **Cleanup** | `del-nodemodules`, `del-yarncaches`, `del-gradle` | Cache and build directory cleanup |
88
+
89
+ For a complete list of available binaries and utilities, see:
90
+ - [Binary executables](https://github.com/dimaslanjaka/bin/tree/master/bin)
91
+ - [Library modules](https://github.com/dimaslanjaka/bin/tree/master/lib)
92
+ - [Package configuration](https://github.com/dimaslanjaka/bin/blob/master/package.json)
93
+
94
+ ### Git Tools
95
+
96
+ #### Git Repository Purge
97
+ Clean and optimize git repositories by pruning reflogs:
98
+
99
+ ```bash
100
+ git-purge
101
+ ```
102
+
103
+ ![Git purge screenshot](https://github.com/dimaslanjaka/bin/assets/12471057/2805c54e-28a7-491d-b381-de2593a854b3)
104
+
105
+ #### Git Diff Utility
106
+ Enhanced git diff functionality:
107
+
108
+ ```bash
109
+ git-diff
110
+ ```
111
+
112
+ #### Git Encoding Fixer
113
+ Fix git file encoding issues:
114
+
115
+ ```bash
116
+ git-fix-encoding
117
+ ```
118
+
119
+ #### Git Repository Size Reducer
120
+ Reduce git repository size by cleaning up history:
121
+
122
+ ```bash
123
+ git-reduce-size
124
+ ```
125
+
126
+ #### Submodule Management
127
+ - **`submodule`** - General submodule operations
128
+ - **`submodule-install`** - Install and setup submodules
129
+ - **`submodule-remove`** - Remove git submodules with interactive selection
130
+ - **`submodule-token`** - Manage submodule tokens
131
+
132
+ ![Submodule remover screenshot](https://github.com/user-attachments/assets/659c2fa3-f12f-45cb-a66f-aed3807e0023)
133
+
134
+
135
+ ### NPM Script Runner
136
+
137
+ **Binaries**: `nrs`, `run-s`, `run-series`, `npm-run-series`
62
138
 
63
- see all binary at
64
- - https://github.com/dimaslanjaka/bin/tree/master/bin
65
- - https://github.com/dimaslanjaka/bin/tree/master/lib
66
- - https://github.com/dimaslanjaka/bin/blob/master/package.json
139
+ Run multiple npm scripts in series with pattern matching support.
67
140
 
68
- ### npm scripts runner
141
+ #### Options
69
142
 
70
- > binaries: `nrs`, `run-s`, `run-series`
143
+ | Flag | Description |
144
+ |------|-------------|
145
+ | `--yarn` | Use `yarn run <script-name>` instead of npm |
146
+ | `--verbose`, `-v` | Enable verbose output |
71
147
 
72
- | arg | description |
73
- | :--- | :--- |
74
- | `--yarn` | using `yarn run <script-name>` |
75
- | `--verbose` `-v` | using `yarn run <script-name>` |
148
+ #### Example
76
149
 
77
- example: `npm run namescript`
150
+ Execute all scripts matching the pattern `namescript:**`:
78
151
 
79
152
  ```json
80
153
  {
@@ -92,44 +165,119 @@ example: `npm run namescript`
92
165
  }
93
166
  ```
94
167
 
95
- ## node_modules cleaner
168
+ ### Package Management Tools
169
+
170
+ #### Yarn Package Reinstaller
171
+ Reinstall yarn packages with dependency type flags:
172
+
173
+ ```bash
174
+ yarn-reinstall <packageName> [--dev|-D|--peer|-P|--optional|-O]
175
+ ```
176
+
177
+ #### Package Resolutions Manager
178
+ Manage package resolutions in package.json:
179
+
180
+ ```bash
181
+ package-resolutions
182
+ ```
183
+
184
+ ### Node.js Development Tools
185
+
186
+ #### Node Modules Finder
187
+ Find all node_modules directories in a project:
188
+
189
+ ```bash
190
+ find-node-modules # Library function
191
+ find-node-modules-cli # CLI tool
192
+ find-nodemodules # Alias
193
+ ```
194
+
195
+ #### Development Environment Helpers
196
+ - **`dev`** - Development environment setup
197
+ - **`prod`** - Production environment setup
198
+ - **`empty`** - Empty utility tool
199
+
200
+ ### Process Management Tools
201
+
202
+ #### Process Killers
203
+ Kill processes by name or pattern:
204
+
205
+ ```bash
206
+ kill-process # General process killer
207
+ nodekill # Kill Node.js processes
208
+ javakill # Kill Java processes (Windows)
209
+ del-ps # Kill processes by command name
210
+ ```
211
+
212
+ #### File System Tools
213
+ - **`rmfind`** - Find and remove files
214
+ - **`rmpath`** - Remove from PATH
215
+ - **`rmx`** - Remove executable files
216
+
217
+ ### Cleanup Tools
218
+
219
+ #### Node Modules Cleaner
220
+ Remove node_modules directories recursively:
96
221
 
97
222
  ```bash
98
- del-nodemodules
223
+ del-nodemodules # Primary command
224
+ del-node-modules # Alternative
225
+ clean-nodemodule # Legacy
226
+ clean-nodemodules # Legacy
99
227
  ```
100
228
 
101
- ![image](https://github.com/dimaslanjaka/bin/assets/12471057/f03e5b51-1808-4e82-a474-0dd3c7eab5fe)
229
+ ![Node modules cleaner screenshot](https://github.com/dimaslanjaka/bin/assets/12471057/f03e5b51-1808-4e82-a474-0dd3c7eab5fe)
230
+
231
+ #### Yarn Cache Cleaner
232
+ Clear yarn cache directories:
233
+
234
+ ```bash
235
+ del-yarncaches # Primary command
236
+ del-yarn-caches # Alternative
237
+ ```
102
238
 
103
- ## yarn caches cleaner
239
+ #### Gradle Build Cleaner
240
+ Delete gradle build folders:
104
241
 
105
242
  ```bash
106
- del-yarncaches
243
+ del-gradle
107
244
  ```
108
245
 
109
- ![image](https://github.com/dimaslanjaka/bin/assets/12471057/2805c54e-28a7-491d-b381-de2593a854b3)
246
+ ## Troubleshooting
110
247
 
111
- ## troubleshooting
112
- ### submodule-install
248
+ ### Submodule Installation Issues
249
+
250
+ If you encounter the following error:
113
251
 
114
- when you're facing error like
115
252
  ```log
116
253
  fatal: 'origin/<branch>' is not a commit and a branch '<branch>' cannot be created from it
117
254
  fatal: unable to checkout submodule '<folder>/<submodule>'
118
255
  ```
119
256
 
120
- solution: deleting `.git/modules` before execute `submodule-install`.
257
+ **Solution**: Delete `.git/modules` directory before running `submodule-install`.
258
+
259
+ #### Complete Submodule Setup Example
121
260
 
122
- example single execution:
123
261
  ```bash
124
- echo "init submodules"
262
+ echo "Initializing submodules..."
125
263
  git submodule init
126
264
  git submodule foreach "git submodule init"
127
- echo "sync submodules"
265
+
266
+ echo "Syncing submodules..."
128
267
  git submodule sync
129
268
  git submodule foreach "git submodule sync"
130
- echo "update submodules"
269
+
270
+ echo "Updating submodules..."
131
271
  mkdir -p bin >/dev/null 2>&1
132
272
  curl -L https://github.com/dimaslanjaka/bin/raw/master/bin/submodule-install > bin/submodule-install
133
273
  rm -rf .git/modules
134
274
  bash ./bin/submodule-install
135
275
  ```
276
+
277
+ ## Contributing
278
+
279
+ Contributions are welcome! Please feel free to submit a Pull Request.
280
+
281
+ ## License
282
+
283
+ This project is licensed under the terms specified in the LICENSE file.