binary-collections 2.0.6 → 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 (95) hide show
  1. package/bin/git-diff.cmd +4 -0
  2. package/bin/git-fix-encoding.cmd +0 -0
  3. package/bin/nodekill.cmd +0 -0
  4. package/bin/nodekill.ps1 +0 -0
  5. package/bin/submodule-install +0 -0
  6. package/lib/{chunk-GA4DDV65.mjs → chunk-3LOB2P54.mjs} +3 -3
  7. package/lib/{chunk-M4IBUK4H.mjs → chunk-4LEXWIIF.mjs} +2 -2
  8. package/lib/chunk-BSD5CIRU.mjs +52 -0
  9. package/lib/chunk-FB6YIQYR.mjs +42 -0
  10. package/lib/{chunk-E75HJFJO.mjs → chunk-JL32QDSH.mjs} +2 -2
  11. package/lib/{chunk-LPLPQBYP.mjs → chunk-OKYLF2MU.mjs} +14 -14
  12. package/lib/chunk-VXZQNLPU.mjs +23 -0
  13. package/lib/del-gradle.cjs +12 -12
  14. package/lib/del-gradle.d.ts +1 -2
  15. package/lib/del-gradle.js +12 -69
  16. package/lib/del-gradle.mjs +3 -3
  17. package/lib/del-node-modules.cjs +12 -12
  18. package/lib/del-node-modules.d.ts +1 -2
  19. package/lib/del-node-modules.js +11 -68
  20. package/lib/del-node-modules.mjs +3 -3
  21. package/lib/del-ps.cjs +13 -626
  22. package/lib/del-ps.d.ts +1 -2
  23. package/lib/del-ps.js +27 -702
  24. package/lib/del-ps.mjs +5 -8
  25. package/lib/del-yarn-caches.cjs +12 -12
  26. package/lib/del-yarn-caches.d.ts +1 -2
  27. package/lib/del-yarn-caches.js +6 -63
  28. package/lib/del-yarn-caches.mjs +3 -3
  29. package/lib/find-node-modules-cli.cjs +59 -0
  30. package/lib/find-node-modules-cli.d.mts +1 -0
  31. package/lib/find-node-modules-cli.d.ts +2 -0
  32. package/lib/find-node-modules-cli.js +3 -0
  33. package/lib/find-node-modules-cli.mjs +14 -0
  34. package/lib/find-node-modules.cjs +31 -9
  35. package/lib/find-node-modules.d.mts +9 -1
  36. package/lib/find-node-modules.d.ts +9 -2
  37. package/lib/find-node-modules.js +41 -12
  38. package/lib/find-node-modules.mjs +5 -19
  39. package/lib/git-diff.cjs +74 -0
  40. package/lib/git-diff.d.cts +2 -0
  41. package/lib/git-diff.d.mts +87 -0
  42. package/lib/git-diff.d.ts +87 -0
  43. package/lib/git-diff.mjs +83 -0
  44. package/lib/git-purge.cjs +13 -626
  45. package/lib/git-purge.d.ts +1 -2
  46. package/lib/git-purge.js +53 -698
  47. package/lib/git-purge.mjs +4 -7
  48. package/lib/index.cjs +91 -1
  49. package/lib/index.d.mts +1 -2
  50. package/lib/index.d.ts +2 -2
  51. package/lib/index.js +8 -2
  52. package/lib/index.mjs +12 -3
  53. package/lib/npm-run-series.d.ts +1 -0
  54. package/lib/npm-run-series.js +80 -56
  55. package/lib/npm-run-series.mjs +2 -2
  56. package/lib/package-resolutions.mjs +1 -1
  57. package/lib/ps/connected-domain.cjs +0 -0
  58. package/lib/ps/connected-domain.d.ts +1 -2
  59. package/lib/ps/connected-domain.js +196 -150
  60. package/lib/ps/connected-domain.mjs +3 -3
  61. package/lib/ps/index.cjs +0 -0
  62. package/lib/ps/index.d.mjs +2 -2
  63. package/lib/ps/index.d.ts +2 -26
  64. package/lib/ps/index.js +230 -535
  65. package/lib/ps/index.mjs +5 -5
  66. package/lib/ps/isWin.cjs +0 -0
  67. package/lib/ps/isWin.d.ts +1 -2
  68. package/lib/ps/isWin.js +1 -2
  69. package/lib/ps/isWin.mjs +3 -3
  70. package/lib/ps/table-parser.cjs +0 -0
  71. package/lib/ps/table-parser.d.ts +1 -3
  72. package/lib/ps/table-parser.js +254 -345
  73. package/lib/ps/table-parser.mjs +4 -4
  74. package/lib/submodule-install.cjs +118 -0
  75. package/lib/submodule-install.d.cts +2 -0
  76. package/lib/submodule-install.d.mts +141 -0
  77. package/lib/submodule-install.d.ts +141 -0
  78. package/lib/submodule-install.mjs +116 -0
  79. package/lib/utils.cjs +12 -12
  80. package/lib/utils.d.ts +4 -8
  81. package/lib/utils.js +43 -28
  82. package/lib/utils.mjs +3 -3
  83. package/lib/yarn-reinstall.cjs +42 -0
  84. package/lib/yarn-reinstall.d.cts +1 -0
  85. package/lib/yarn-reinstall.d.mts +45 -0
  86. package/lib/yarn-reinstall.d.ts +45 -0
  87. package/lib/yarn-reinstall.mjs +50 -0
  88. package/package.json +37 -39
  89. package/readme.md +174 -49
  90. package/eslint.config.cjs +0 -97
  91. package/lib/chunk-7MSZ52XC.mjs +0 -14
  92. package/lib/chunk-AVDT32AY.mjs +0 -20
  93. package/lib/chunk-S4SJ7SDW.mjs +0 -625
  94. package/lib/package-resolutions.js +0 -28
  95. package/lib/ps/index.d.js +0 -17
@@ -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,8 +1,21 @@
1
1
  {
2
2
  "name": "binary-collections",
3
- "version": "2.0.6",
3
+ "version": "2.0.7",
4
4
  "description": "Utility to clean any programming caches and more",
5
- "main": "index.js",
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",
@@ -11,13 +24,16 @@
11
24
  "package.json"
12
25
  ],
13
26
  "directories": {
14
- "lib": "lib"
27
+ "lib": "lib",
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 build.tsup.js && npm run postbuild",
32
+ "build": "node build.tsup.js && tsc -b tsconfig.build.json && npm run postbuild",
19
33
  "postbuild": "node -r ts-node/register -r dotenv/config build.js && yarn run pack",
20
- "test": "cd test && npm install -D file:../ &&",
34
+ "test": "jest",
35
+ "test:watch": "jest --watch",
36
+ "test:coverage": "jest --coverage",
21
37
  "test:nrs": "npm test -- nrs build:**",
22
38
  "pack": "node packer.js --yarn --filename=bin",
23
39
  "update:ncu": "npx npm-check-updates -u -x jsdom,chalk,hexo,deepmerge-ts --enginesNode --root",
@@ -56,10 +72,11 @@
56
72
  "yaml": "^2.5.1",
57
73
  "yarn": "^1.22.22"
58
74
  },
59
- "packageManager": "yarn@4.5.0",
75
+ "packageManager": "yarn@4.9.2",
60
76
  "devDependencies": {
61
77
  "@types/eslint": "^9",
62
78
  "@types/fs-extra": "^11.0.4",
79
+ "@types/jest": "^30.0.0",
63
80
  "@types/minimist": "^1",
64
81
  "@types/node": "^22.7.4",
65
82
  "@types/prettier": "^3",
@@ -73,8 +90,10 @@
73
90
  "eslint-plugin-prettier": "^5.2.1",
74
91
  "git-command-helper": "^2.0.2",
75
92
  "globals": "^15.10.0",
93
+ "jest": "^30.0.4",
76
94
  "prettier": "^3.3.3",
77
95
  "rimraf": "^6.0.1",
96
+ "ts-jest": "^29.4.0",
78
97
  "ts-node": "^10.9.2",
79
98
  "tsup": "^8.3.0",
80
99
  "typescript": "^5.6.2"
@@ -85,47 +104,28 @@
85
104
  "bin": {
86
105
  "clean-nodemodule": "bin/clean-nodemodule",
87
106
  "clean-nodemodules": "bin/clean-nodemodules",
88
- "connected-domain-cjs": "lib/ps/connected-domain.cjs",
89
- "connected-domain-mjs": "lib/ps/connected-domain.mjs",
90
107
  "del-gradle": "lib/del-gradle.cjs",
91
- "del-gradle-cjs": "lib/del-gradle.cjs",
92
- "del-gradle-mjs": "lib/del-gradle.mjs",
93
- "del-node-modules-cjs": "lib/del-node-modules.cjs",
94
- "del-node-modules-mjs": "lib/del-node-modules.mjs",
108
+ "del-node-modules": "lib/del-node-modules.cjs",
95
109
  "del-nodemodules": "lib/del-node-modules.cjs",
96
110
  "del-ps": "lib/del-ps.cjs",
97
- "del-ps-cjs": "lib/del-ps.cjs",
98
- "del-ps-mjs": "lib/del-ps.mjs",
99
- "del-yarn-caches-cjs": "lib/del-yarn-caches.cjs",
100
- "del-yarn-caches-mjs": "lib/del-yarn-caches.mjs",
111
+ "del-yarn-caches": "lib/del-yarn-caches.cjs",
101
112
  "del-yarncaches": "lib/del-yarn-caches.cjs",
102
113
  "dev": "bin/dev",
103
114
  "empty": "bin/empty",
104
- "eslint-config-cjs": "eslint.config.cjs",
105
- "find-node-modules-cjs": "lib/find-node-modules.cjs",
106
- "find-node-modules-mjs": "lib/find-node-modules.mjs",
107
- "find-nodemodules": "lib/find-node-modules.cjs",
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",
108
119
  "git-fix-encoding": "bin/git-fix-encoding",
109
- "git-fix-encoding-cmd": "bin/git-fix-encoding.cmd",
110
120
  "git-purge": "lib/git-purge.cjs",
111
- "git-purge-cjs": "lib/git-purge.cjs",
112
- "git-purge-mjs": "lib/git-purge.mjs",
113
121
  "git-reduce-size": "bin/git-reduce-size",
114
- "index-cjs": "lib/ps/index.cjs",
115
- "index-mjs": "lib/ps/index.mjs",
116
- "isWin-cjs": "lib/ps/isWin.cjs",
117
- "isWin-mjs": "lib/ps/isWin.mjs",
118
- "javakill-cmd": "bin/javakill.cmd",
122
+ "index": "lib/index.cjs",
123
+ "javakill": "bin/javakill.cmd",
119
124
  "kill-process": "bin/kill-process",
120
125
  "nodekill": "bin/nodekill",
121
- "nodekill-cmd": "bin/nodekill.cmd",
122
- "nodekill-ps1": "bin/nodekill.ps1",
123
126
  "npm-run-series": "lib/npm-run-series.cjs",
124
- "npm-run-series-cjs": "lib/npm-run-series.cjs",
125
- "npm-run-series-mjs": "lib/npm-run-series.mjs",
126
127
  "nrs": "lib/npm-run-series.cjs",
127
- "package-resolutions-cjs": "lib/package-resolutions.cjs",
128
- "package-resolutions-mjs": "lib/package-resolutions.mjs",
128
+ "package-resolutions": "lib/package-resolutions.cjs",
129
129
  "prod": "bin/prod",
130
130
  "rmfind": "bin/rmfind",
131
131
  "rmpath": "bin/rmpath",
@@ -133,12 +133,10 @@
133
133
  "run-s": "lib/npm-run-series.cjs",
134
134
  "run-series": "lib/npm-run-series.cjs",
135
135
  "submodule": "bin/submodule",
136
- "submodule-install": "bin/submodule-install",
136
+ "submodule-install": "lib/submodule-install.cjs",
137
137
  "submodule-remove": "bin/submodule-remove",
138
138
  "submodule-token": "bin/submodule-token",
139
- "table-parser-cjs": "lib/ps/table-parser.cjs",
140
- "table-parser-mjs": "lib/ps/table-parser.mjs",
141
- "utils-cjs": "lib/utils.cjs",
142
- "utils-mjs": "lib/utils.mjs"
139
+ "utils": "lib/utils.cjs",
140
+ "yarn-reinstall": "lib/yarn-reinstall.cjs"
143
141
  }
144
142
  }
package/readme.md CHANGED
@@ -1,26 +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 install as global package
23
+
24
+ # Install globally
15
25
  npm install binary-collections -g
16
- # or
26
+
27
+ # Install from Git
17
28
  npm install binary-collections@git+https://github.com/dimaslanjaka/bin.git
18
- # or
29
+
30
+ # Install from release archive
19
31
  npm install binary-collections@https://github.com/dimaslanjaka/bin/raw/master/releases/bin.tgz
20
32
  ```
21
33
 
22
- ## Setup vscode
23
- create `.vscode/settings.json`
34
+ ## VS Code Setup
35
+
36
+ Create `.vscode/settings.json` to add binary tools to your PATH:
37
+
24
38
  ```jsonc
25
39
  {
26
40
  "terminal.integrated.env.linux": {
@@ -47,41 +61,93 @@ create `.vscode/settings.json`
47
61
  },
48
62
  "Cygwin": {
49
63
  "path": "C:\\cygwin64\\bin\\bash.exe",
50
- "args": [
51
- "--login",
52
- "-i"
53
- ],
64
+ "args": ["--login", "-i"],
54
65
  "env": {
55
66
  "CHERE_INVOKING": "1"
56
67
  }
57
68
  }
58
69
  },
59
- "terminal.integrated.defaultProfile.windows": "Command Prompt",
70
+ "terminal.integrated.defaultProfile.windows": "Command Prompt"
60
71
  }
61
72
  ```
62
73
 
63
- ## 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
64
131
 
65
- see all binary at
66
- - https://github.com/dimaslanjaka/bin/tree/master/bin
67
- - https://github.com/dimaslanjaka/bin/tree/master/lib
68
- - https://github.com/dimaslanjaka/bin/blob/master/package.json
132
+ ![Submodule remover screenshot](https://github.com/user-attachments/assets/659c2fa3-f12f-45cb-a66f-aed3807e0023)
69
133
 
70
- submodule remover
71
134
 
72
- ![image](https://github.com/user-attachments/assets/659c2fa3-f12f-45cb-a66f-aed3807e0023)
135
+ ### NPM Script Runner
73
136
 
137
+ **Binaries**: `nrs`, `run-s`, `run-series`, `npm-run-series`
74
138
 
75
- ### npm scripts runner
139
+ Run multiple npm scripts in series with pattern matching support.
76
140
 
77
- > binaries: `nrs`, `run-s`, `run-series`
141
+ #### Options
78
142
 
79
- | arg | description |
80
- | :--- | :--- |
81
- | `--yarn` | using `yarn run <script-name>` |
82
- | `--verbose` `-v` | using `yarn run <script-name>` |
143
+ | Flag | Description |
144
+ |------|-------------|
145
+ | `--yarn` | Use `yarn run <script-name>` instead of npm |
146
+ | `--verbose`, `-v` | Enable verbose output |
83
147
 
84
- example: `npm run namescript`
148
+ #### Example
149
+
150
+ Execute all scripts matching the pattern `namescript:**`:
85
151
 
86
152
  ```json
87
153
  {
@@ -99,60 +165,119 @@ example: `npm run namescript`
99
165
  }
100
166
  ```
101
167
 
102
- ## 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:
103
179
 
104
180
  ```bash
105
- del-nodemodules
181
+ package-resolutions
106
182
  ```
107
183
 
108
- ![image](https://github.com/dimaslanjaka/bin/assets/12471057/f03e5b51-1808-4e82-a474-0dd3c7eab5fe)
184
+ ### Node.js Development Tools
109
185
 
110
- ## yarn caches cleaner
186
+ #### Node Modules Finder
187
+ Find all node_modules directories in a project:
111
188
 
112
189
  ```bash
113
- del-yarncaches
190
+ find-node-modules # Library function
191
+ find-node-modules-cli # CLI tool
192
+ find-nodemodules # Alias
114
193
  ```
115
194
 
116
- ## gradle caches cleaner
195
+ #### Development Environment Helpers
196
+ - **`dev`** - Development environment setup
197
+ - **`prod`** - Production environment setup
198
+ - **`empty`** - Empty utility tool
117
199
 
118
- - delete gradle build folder
200
+ ### Process Management Tools
201
+
202
+ #### Process Killers
203
+ Kill processes by name or pattern:
119
204
 
120
205
  ```bash
121
- del-gradle
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
122
210
  ```
123
211
 
124
- ## Git purge
212
+ #### File System Tools
213
+ - **`rmfind`** - Find and remove files
214
+ - **`rmpath`** - Remove from PATH
215
+ - **`rmx`** - Remove executable files
125
216
 
126
- - prune reflogs from all git repositories
217
+ ### Cleanup Tools
218
+
219
+ #### Node Modules Cleaner
220
+ Remove node_modules directories recursively:
127
221
 
128
222
  ```bash
129
- git-purge
223
+ del-nodemodules # Primary command
224
+ del-node-modules # Alternative
225
+ clean-nodemodule # Legacy
226
+ clean-nodemodules # Legacy
227
+ ```
228
+
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
+ ```
238
+
239
+ #### Gradle Build Cleaner
240
+ Delete gradle build folders:
241
+
242
+ ```bash
243
+ del-gradle
130
244
  ```
131
245
 
132
- ![image](https://github.com/dimaslanjaka/bin/assets/12471057/2805c54e-28a7-491d-b381-de2593a854b3)
246
+ ## Troubleshooting
247
+
248
+ ### Submodule Installation Issues
133
249
 
134
- ## troubleshooting
135
- ### submodule-install
250
+ If you encounter the following error:
136
251
 
137
- when you're facing error like
138
252
  ```log
139
253
  fatal: 'origin/<branch>' is not a commit and a branch '<branch>' cannot be created from it
140
254
  fatal: unable to checkout submodule '<folder>/<submodule>'
141
255
  ```
142
256
 
143
- solution: deleting `.git/modules` before execute `submodule-install`.
257
+ **Solution**: Delete `.git/modules` directory before running `submodule-install`.
258
+
259
+ #### Complete Submodule Setup Example
144
260
 
145
- example single execution:
146
261
  ```bash
147
- echo "init submodules"
262
+ echo "Initializing submodules..."
148
263
  git submodule init
149
264
  git submodule foreach "git submodule init"
150
- echo "sync submodules"
265
+
266
+ echo "Syncing submodules..."
151
267
  git submodule sync
152
268
  git submodule foreach "git submodule sync"
153
- echo "update submodules"
269
+
270
+ echo "Updating submodules..."
154
271
  mkdir -p bin >/dev/null 2>&1
155
272
  curl -L https://github.com/dimaslanjaka/bin/raw/master/bin/submodule-install > bin/submodule-install
156
273
  rm -rf .git/modules
157
274
  bash ./bin/submodule-install
158
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.