binary-collections 2.0.3 → 2.0.5

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.
@@ -0,0 +1,19 @@
1
+ const glob = require('glob');
2
+ const { delStream } = require('./utils');
3
+ // process.cwd = () => path.resolve(__dirname + '/../../../Repositories');
4
+
5
+ const globalIgnore = [
6
+ // ignore .git .github folder
7
+ '**/.git*',
8
+ // ignore composer folder
9
+ '**/vendor/**'
10
+ ];
11
+
12
+ console.log('cleaning node_modules in', process.cwd());
13
+
14
+ const g3 = new glob.Glob('**/node_modules', {
15
+ withFileTypes: false,
16
+ cwd: process.cwd(),
17
+ ignore: globalIgnore
18
+ });
19
+ delStream(g3);
@@ -0,0 +1,11 @@
1
+ const glob = require('glob');
2
+ const { delStream } = require('./utils');
3
+ // const path = require('path');
4
+ // process.cwd = () => path.resolve(__dirname + '/../../../Repositories');
5
+
6
+ const g3 = new glob.Glob(['**/.yarn/cache*', '**/.yarn/*.gz'], {
7
+ withFileTypes: false,
8
+ cwd: process.cwd(),
9
+ ignore: ['**/.git*', '**/vendor/**']
10
+ });
11
+ delStream(g3);
File without changes
@@ -1,28 +1,10 @@
1
- const glob = require('glob');
2
1
  const { fs, path } = require('sbg-utility');
3
- // process.cwd = () => path.resolve(__dirname + '/../../../Repositories');
4
-
5
- const globalIgnore = [
6
- // ignore .git .github folder
7
- '**/.git*',
8
- // ignore composer folder
9
- '**/vendor/**'
10
- ];
11
-
12
- console.log('cleaning node_modules in', process.cwd());
13
-
14
- const g3 = new glob.Glob('**/node_modules', {
15
- withFileTypes: false,
16
- cwd: process.cwd(),
17
- ignore: globalIgnore
18
- });
19
- streamDel(g3);
20
2
 
21
3
  /**
22
4
  * glob stream handler
23
5
  * @param {glob.Glob} globStream
24
6
  */
25
- function streamDel(globStream) {
7
+ function delStream(globStream) {
26
8
  globStream.stream().on('data', (result) => {
27
9
  const fullPath = path.resolve(process.cwd(), result);
28
10
  console.log('deleting', fullPath);
@@ -50,3 +32,5 @@ function del(fullPath) {
50
32
  console.log('failed delete', fullPath);
51
33
  }
52
34
  }
35
+
36
+ module.exports = { del, delStream };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "binary-collections",
3
- "version": "2.0.3",
3
+ "version": "2.0.5",
4
4
  "description": "binary helper collections by L3n4r0x",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -22,7 +22,19 @@
22
22
  "update:ncu": "npx npm-check-updates -u -x jsdom,chalk,hexo,deepmerge-ts --enginesNode --root"
23
23
  },
24
24
  "keywords": [],
25
- "author": "",
25
+ "author": {
26
+ "email": "dimaslanjaka@gmail.com",
27
+ "name": "dimaslanjaka",
28
+ "url": "https://webmanajemen.com"
29
+ },
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "git+https://github.com/dimaslanjaka/bin"
33
+ },
34
+ "bugs": {
35
+ "url": "https://github.com/dimaslanjaka/bin/issues"
36
+ },
37
+ "homepage": "https://www.webmanajemen.com/",
26
38
  "license": "MIT",
27
39
  "dependencies": {
28
40
  "execa": "^8.0.1",
@@ -59,10 +71,11 @@
59
71
  "bin": {
60
72
  "clean-nodemodule": "bin/clean-nodemodule",
61
73
  "clean-nodemodules": "bin/clean-nodemodules",
62
- "del-nodemodules": "lib/del-nodemodules.js",
74
+ "del-nodemodules": "lib/del-node-modules.js",
75
+ "del-yarncaches": "lib/del-yarn-caches.js",
63
76
  "dev": "bin/dev",
64
77
  "empty": "bin/empty",
65
- "find-nodemodules": "lib/find-nodemodules.js",
78
+ "find-nodemodules": "lib/find-node-modules.js",
66
79
  "git-fix-encoding": "bin/git-fix-encoding",
67
80
  "git-fix-encoding-cmd": "bin/git-fix-encoding.cmd",
68
81
  "git-reduce-size": "bin/git-reduce-size",
package/readme.md CHANGED
@@ -10,6 +10,8 @@ git clone -b master https://github.com/dimaslanjaka/bin bin
10
10
 
11
11
  via npm
12
12
  ```bash
13
+ npm install binary-collections
14
+ # or
13
15
  npm install binary-collections@git+https://github.com/dimaslanjaka/bin.git
14
16
  # or
15
17
  npm install binary-collections@https://github.com/dimaslanjaka/bin/raw/master/releases/bin.tgz
@@ -90,6 +92,22 @@ example: `npm run namescript`
90
92
  }
91
93
  ```
92
94
 
95
+ ## node_modules cleaner
96
+
97
+ ```bash
98
+ del-nodemodules
99
+ ```
100
+
101
+ ![image](https://github.com/dimaslanjaka/bin/assets/12471057/f03e5b51-1808-4e82-a474-0dd3c7eab5fe)
102
+
103
+ ## yarn caches cleaner
104
+
105
+ ```bash
106
+ del-yarncaches
107
+ ```
108
+
109
+ ![image](https://github.com/dimaslanjaka/bin/assets/12471057/2805c54e-28a7-491d-b381-de2593a854b3)
110
+
93
111
  ## troubleshooting
94
112
  ### submodule-install
95
113