@chahuadev/chahuadev-hub-app 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.
Files changed (4) hide show
  1. package/README.md +56 -0
  2. package/index.js +47 -0
  3. package/install.js +98 -0
  4. package/package.json +39 -0
package/README.md ADDED
@@ -0,0 +1,56 @@
1
+ # @chahuadev/chahuadev-hub-app
2
+
3
+ **Chahuadev Hub** — The official app launcher and distribution hub by Chahuadev.
4
+
5
+ <div align="center">
6
+
7
+ <p align="center">
8
+ <img src="https://huggingface.co/datasets/chahuadev/chahuadev-framework-binaries/resolve/main/chahuadev_hub.png" width="600" alt="Chahuadev Hub — App Launcher">
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/package/@chahuadev/chahuadev-hub-app"><img src="https://img.shields.io/npm/v/@chahuadev/chahuadev-hub-app?style=for-the-badge&color=blue" alt="NPM Version"></a>
13
+ <a href="https://www.npmjs.com/package/@chahuadev/chahuadev-hub-app"><img src="https://img.shields.io/npm/dt/@chahuadev/chahuadev-hub-app?style=for-the-badge&color=success" alt="NPM Downloads"></a>
14
+ <img src="https://img.shields.io/badge/Platform-Windows-0078D4?style=for-the-badge&logo=windows&logoColor=white" alt="Windows">
15
+ <img src="https://img.shields.io/badge/License-MIT-green?style=for-the-badge" alt="MIT">
16
+ </p>
17
+
18
+ </div>
19
+
20
+ ---
21
+
22
+ ## āš™ļø Installation
23
+
24
+ > **Auto-download:** On install, the binary for your platform is downloaded automatically. Use `--foreground-scripts` to see the progress bar.
25
+
26
+ ### Global Install (Recommended)
27
+
28
+ ```bash
29
+ npm install -g @chahuadev/chahuadev-hub-app --foreground-scripts --force
30
+ ```
31
+
32
+ ### Launch
33
+
34
+ ```bash
35
+ chahuadev-hub
36
+ ```
37
+
38
+ ---
39
+
40
+ ## šŸš€ What It Does
41
+
42
+ Download and manage all Chahuadev apps in one place — including **Chahuadev Framework**, **Emoji Cleaner**, and **Junk Sweeper** — through a sleek dark-mode GUI.
43
+
44
+ ### ✨ Features
45
+
46
+ - 🌐 **Cloud Sync** — Fetches the latest app list directly from the Chahuadev Hugging Face repository
47
+ - ā¬‡ļø **Smart Download** — Real-time progress bar with file size and integrity verification
48
+ - 🪟 **Windows Support** — Native `.exe` installer for Windows 64-bit and 32-bit
49
+ - šŸ” **Filtering** — Sort available apps by platform
50
+
51
+ ---
52
+
53
+ ## šŸ”— Links
54
+
55
+ - [Hugging Face](https://huggingface.co/chahuadev)
56
+ - [PyPI](https://pypi.org/project/chahuadev-hub/)
package/index.js ADDED
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ const path = require('path');
4
+ const { spawnSync } = require('child_process');
5
+ const os = require('os');
6
+ const fs = require('fs');
7
+
8
+ const platform = os.platform();
9
+ const arch = os.arch();
10
+
11
+ let exeName = '';
12
+
13
+ if (platform === 'win32') {
14
+ exeName = arch === 'ia32' ? 'chahuadev-hub-win-ia32.exe' : 'chahuadev-hub-win-x64.exe';
15
+ } else if (platform === 'linux') {
16
+ exeName = 'chahuadev-hub-linux';
17
+ } else {
18
+ console.error(`āŒ Chahuadev Hub does not support ${platform} ${arch} yet.`);
19
+ process.exit(1);
20
+ }
21
+
22
+ const getPath = () => {
23
+ const exePath = path.join(__dirname, 'bin', exeName);
24
+ if (!fs.existsSync(exePath)) {
25
+ console.error(`\nāŒ Executable not found: ${exePath}`);
26
+ console.error('šŸ‘‰ Try reinstalling: npm install -g @chahuadev/chahuadev-hub-app --foreground-scripts --force\n');
27
+ process.exit(1);
28
+ }
29
+ return exePath;
30
+ };
31
+
32
+ const run = () => {
33
+ try {
34
+ const exePath = getPath();
35
+ const args = process.argv.slice(2);
36
+ spawnSync(exePath, args, { stdio: 'inherit' });
37
+ } catch (error) {
38
+ console.error('āŒ Failed to start Chahuadev Hub:', error.message);
39
+ process.exit(1);
40
+ }
41
+ };
42
+
43
+ if (require.main === module) {
44
+ run();
45
+ } else {
46
+ module.exports = { run, getPath };
47
+ }
package/install.js ADDED
@@ -0,0 +1,98 @@
1
+ 'use strict';
2
+ const fs = require('fs');
3
+ const path = require('path');
4
+ const https = require('https');
5
+ const os = require('os');
6
+
7
+ const platform = os.platform();
8
+ const arch = os.arch();
9
+
10
+ let downloadUrl = '';
11
+ let fileName = '';
12
+
13
+ if (platform === 'win32') {
14
+ if (arch === 'ia32') {
15
+ downloadUrl = 'https://huggingface.co/datasets/chahuadev/chahuadev-framework-binaries/resolve/main/chahuadev_hub-win-ia32.exe?download=true';
16
+ fileName = 'chahuadev-hub-win-ia32.exe';
17
+ } else {
18
+ downloadUrl = 'https://huggingface.co/datasets/chahuadev/chahuadev-framework-binaries/resolve/main/chahuadev_hub-win-x64.exe?download=true';
19
+ fileName = 'chahuadev-hub-win-x64.exe';
20
+ }
21
+ } else if (platform === 'linux') {
22
+ downloadUrl = 'https://huggingface.co/datasets/chahuadev/chahuadev-framework-binaries/resolve/main/chahuadev_hub?download=true';
23
+ fileName = 'chahuadev-hub-linux';
24
+ }
25
+
26
+ if (!downloadUrl) {
27
+ console.warn(`\nāš ļø Skipping download: Chahuadev Hub does not support ${platform} ${arch} yet.`);
28
+ process.exit(0);
29
+ }
30
+
31
+ const binDir = path.join(__dirname, 'bin');
32
+ if (!fs.existsSync(binDir)) {
33
+ fs.mkdirSync(binDir, { recursive: true });
34
+ }
35
+
36
+ const filePath = path.join(binDir, fileName);
37
+
38
+ console.log(`\nšŸš€ Chahuadev Hub — Downloading binary for ${platform} (${arch})...`);
39
+ console.log(`ā³ Please wait, this may take a few minutes depending on your connection.\n`);
40
+
41
+ function downloadFile(url, dest) {
42
+ https.get(url, (response) => {
43
+ if (response.statusCode === 301 || response.statusCode === 302) {
44
+ return downloadFile(response.headers.location, dest);
45
+ }
46
+
47
+ if (response.statusCode !== 200) {
48
+ console.error(`\nāŒ Download failed: HTTP ${response.statusCode}`);
49
+ process.exit(1);
50
+ }
51
+
52
+ const totalBytes = parseInt(response.headers['content-length'], 10);
53
+ let downloadedBytes = 0;
54
+
55
+ const file = fs.createWriteStream(dest);
56
+
57
+ response.on('data', (chunk) => {
58
+ downloadedBytes += chunk.length;
59
+
60
+ if (!isNaN(totalBytes)) {
61
+ const percent = ((downloadedBytes / totalBytes) * 100).toFixed(1);
62
+ const downloadedMB = (downloadedBytes / (1024 * 1024)).toFixed(1);
63
+ const totalMB = (totalBytes / (1024 * 1024)).toFixed(1);
64
+
65
+ const barLength = 30;
66
+ const filledLength = Math.round((barLength * downloadedBytes) / totalBytes);
67
+ const bar = 'ā–ˆ'.repeat(filledLength) + 'ā–‘'.repeat(barLength - filledLength);
68
+
69
+ process.stdout.write(`\r[${bar}] ${percent}% (${downloadedMB} MB / ${totalMB} MB)`);
70
+ } else {
71
+ const downloadedMB = (downloadedBytes / (1024 * 1024)).toFixed(1);
72
+ process.stdout.write(`\rDownloading... ${downloadedMB} MB`);
73
+ }
74
+ });
75
+
76
+ response.pipe(file);
77
+
78
+ file.on('finish', () => {
79
+ file.close();
80
+ console.log('\n');
81
+ console.log('āœ… Download completed successfully!');
82
+ console.log(`šŸ“‚ Saved to: ${dest}`);
83
+ console.log('');
84
+ console.log('šŸš€ Launch the app with:');
85
+ console.log(' chahuadev-hub');
86
+ console.log(' npx @chahuadev/chahuadev-hub-app\n');
87
+
88
+ if (platform !== 'win32') fs.chmodSync(dest, 0o755);
89
+ });
90
+
91
+ }).on('error', (err) => {
92
+ fs.unlink(dest, () => {});
93
+ console.error('\nāŒ Download failed:', err.message);
94
+ process.exit(1);
95
+ });
96
+ }
97
+
98
+ downloadFile(downloadUrl, filePath);
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@chahuadev/chahuadev-hub-app",
3
+ "version": "1.0.0",
4
+ "description": "Chahuadev Hub — Official app launcher and distribution hub by Chahuadev",
5
+ "main": "index.js",
6
+ "bin": {
7
+ "chahuadev-hub": "index.js"
8
+ },
9
+ "scripts": {
10
+ "postinstall": "node install.js"
11
+ },
12
+ "files": [
13
+ "index.js",
14
+ "install.js"
15
+ ],
16
+ "keywords": [
17
+ "chahuadev",
18
+ "chahuadev-hub",
19
+ "app-launcher",
20
+ "distribution",
21
+ "hub",
22
+ "electron",
23
+ "python"
24
+ ],
25
+ "author": {
26
+ "name": "Chahuadev",
27
+ "email": "chahuadev@gmail.com",
28
+ "url": "https://huggingface.co/chahuadev"
29
+ },
30
+ "license": "MIT",
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "https://huggingface.co/datasets/chahuadev/chahuadev-framework-binaries"
37
+ },
38
+ "homepage": "https://huggingface.co/chahuadev"
39
+ }