instbyte 1.6.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mohit Gauniyal
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,200 @@
1
+ <p align="center">
2
+ <img src="client/assets/logo.png" alt="Instbyte Logo" width="100">
3
+ </p>
4
+
5
+ <h1 align="center">Instbyte</h1>
6
+
7
+ <p align="center">
8
+ A self-hosted LAN sharing utility you can make your own — files, links, and snippets across devices instantly, no cloud required.
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/package/instbyte"><img src="https://img.shields.io/npm/v/instbyte" alt="npm version"></a>
13
+ <a href="https://github.com/mohitgauniyal/instbyte/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/instbyte" alt="license"></a>
14
+ </p>
15
+
16
+ ---
17
+
18
+ **Instbyte** is a high-speed, real-time, short-lived LAN sharing utility built for teams and developers who need to move snippets, links, files, and structured notes across devices instantly — without cloud accounts, logins, or external services.
19
+
20
+ It operates entirely on your local network, acting as a lightweight "digital dead-drop" for frictionless collaboration.
21
+
22
+ Instbyte can also be fully white-labelled — the difference between ***a tool you use*** and ***a tool you own***.
23
+
24
+ ---
25
+
26
+ ## Install & Run
27
+
28
+ **Requires Node.js 18 or higher.**
29
+
30
+ The fastest way — no installation needed:
31
+ ```bash
32
+ npx instbyte
33
+ ```
34
+
35
+ Or install globally and run from anywhere:
36
+ ```bash
37
+ npm install -g instbyte
38
+ instbyte
39
+ ```
40
+
41
+ That's it. Open the displayed URL in any browser on the same network.
42
+
43
+ ---
44
+
45
+ ## How It Works
46
+
47
+ One person runs the server — everyone else on the same WiFi opens the URL in their browser. No accounts, no setup on client devices.
48
+
49
+ ```
50
+ [Your Machine] — runs: npx instbyte
51
+
52
+ http://192.168.x.x:3000
53
+
54
+ [Phone] [Laptop] [Tablet] — open URL in browser
55
+ ```
56
+
57
+ **Sharing is instant:**
58
+ - Type or paste text → hit Send
59
+ - Paste anywhere on the page → auto-sends
60
+ - Drag a file anywhere onto the page → uploads
61
+ - Click any text item → copies to clipboard
62
+ - Click any file item → downloads
63
+
64
+ Everything syncs in real time across all connected devices. Content auto-deletes after 24 hours.
65
+
66
+ ---
67
+
68
+ ## For Teams
69
+
70
+ ### Quick Setup (No Config)
71
+ Run `npx instbyte` on the machine that will act as the server. Share the displayed network URL with your team. Done.
72
+
73
+ ### With Config File
74
+ For teams who want auth, custom retention, or branding — create `instbyte.config.json` in the directory where you run the command:
75
+
76
+ ```json
77
+ {
78
+ "server": {
79
+ "port": 3000
80
+ },
81
+ "auth": {
82
+ "passphrase": "yourteampassword"
83
+ },
84
+ "storage": {
85
+ "maxFileSize": "2GB",
86
+ "retention": "24h"
87
+ },
88
+ "branding": {
89
+ "appName": "Team Hub",
90
+ "primaryColor": "#7c3aed",
91
+ "logoPath": "./logo.png"
92
+ }
93
+ }
94
+ ```
95
+
96
+ Then run `npx instbyte` in the same directory. The config is picked up automatically.
97
+
98
+ ### Keeping It Running
99
+ For persistent team use, run it as a background process:
100
+
101
+ ```bash
102
+ # using pm2
103
+ npm install -g pm2
104
+ pm2 start "npx instbyte" --name instbyte
105
+ pm2 save
106
+ ```
107
+
108
+ Or use any process manager you already have — systemd, screen, tmux.
109
+
110
+ ---
111
+
112
+ ## Configuration
113
+
114
+ Instbyte works out of the box with zero configuration. All options are optional — only include what you want to override.
115
+
116
+ | Key | Default | Description |
117
+ |---|---|---|
118
+ | `server.port` | `3000` | Port to run on. Overridden by `PORT` env var if set |
119
+ | `auth.passphrase` | `""` | Shared passphrase for access. Empty = no auth |
120
+ | `storage.maxFileSize` | `"2GB"` | Max upload size. Accepts `KB`, `MB`, `GB` |
121
+ | `storage.retention` | `"24h"` | How long before items auto-delete. Accepts `h`, `d` |
122
+ | `branding.appName` | `"Instbyte"` | App name in header and browser tab |
123
+ | `branding.primaryColor` | `"#111827"` | Primary brand color in hex. Full palette auto-derived |
124
+ | `branding.logoPath` | — | Path to your logo file relative to where you run the command |
125
+ | `branding.faviconPath` | — | Path to custom favicon. Auto-generated from logo if omitted |
126
+
127
+ ---
128
+
129
+ ## Branding
130
+
131
+ Instbyte can be fully white-labelled — no code changes required. Set a name, a color, and a logo and the entire UI updates automatically including the login page, favicon, buttons, and active states.
132
+
133
+ ```json
134
+ {
135
+ "branding": {
136
+ "appName": "Team Hub",
137
+ "primaryColor": "#7c3aed",
138
+ "logoPath": "./my-logo.png"
139
+ }
140
+ }
141
+ ```
142
+
143
+ The difference between *a tool you use* and *a tool you own.*
144
+
145
+ ---
146
+
147
+ ## Features
148
+
149
+ **Real-time sync** — every action is instantly reflected across all connected devices via WebSockets.
150
+
151
+ **Channels** — organise shared content into named channels. Create, rename, pin, and delete channels on the fly. Pinned channels are protected from accidental deletion.
152
+
153
+ **Rich content** — markdown rendering, syntax highlighting for code, inline image preview, video and audio playback, PDF preview, and text file viewing — all without downloading.
154
+
155
+ **Search** — full-text search across all channels.
156
+
157
+ **Smart port handling** — if port 3000 is busy, Instbyte finds the next available port automatically.
158
+
159
+ **Short-lived by design** — all content auto-deletes after 24 hours. Nothing lingers.
160
+
161
+ **QR join** — built-in QR code so phones can join instantly without typing the URL.
162
+
163
+ ---
164
+
165
+ ## Manual / Self-hosted from Source
166
+
167
+ ```bash
168
+ git clone https://github.com/mohitgauniyal/instbyte
169
+ cd instbyte
170
+ npm install
171
+ node server/server.js
172
+ ```
173
+
174
+ ---
175
+
176
+ ## Use Cases
177
+
178
+ - Moving content between your phone and laptop over WiFi
179
+ - Sharing API payloads, logs, or screenshots during a sprint
180
+ - A lightweight team clipboard during standups or pair sessions
181
+ - Home lab file sharing without setting up NAS or cloud sync
182
+
183
+ ---
184
+
185
+ ## Versioning
186
+
187
+ Instbyte follows [Semantic Versioning](https://semver.org). See [Releases](https://github.com/mohitgauniyal/instbyte/releases) for full changelog.
188
+
189
+ ---
190
+
191
+ ## Contributing
192
+
193
+ Instbyte is intentionally lightweight and LAN-first. If you want to extend it — CLI tools, themes, integrations — open an issue or submit a pull request.
194
+
195
+ ---
196
+
197
+ ## License
198
+
199
+ This project is licensed under the MIT License — see the [LICENSE](LICENSE) file for details.
200
+
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env node
2
+
3
+ "use strict";
4
+
5
+ const path = require("path");
6
+ const fs = require("fs");
7
+
8
+ // ========================
9
+ // DATA DIRECTORY SETUP
10
+ // ========================
11
+ // When run via npx or global install, we want data to live
12
+ // in the user's current working directory, not inside the
13
+ // npm cache or global node_modules.
14
+
15
+ const dataDir = path.join(process.cwd(), "instbyte-data");
16
+ const uploadsDir = path.join(dataDir, "uploads");
17
+
18
+ if (!fs.existsSync(dataDir)) fs.mkdirSync(dataDir, { recursive: true });
19
+ if (!fs.existsSync(uploadsDir)) fs.mkdirSync(uploadsDir, { recursive: true });
20
+
21
+ // Pass locations to the rest of the app via env vars
22
+ process.env.INSTBYTE_DATA = dataDir;
23
+ process.env.INSTBYTE_UPLOADS = uploadsDir;
24
+
25
+ // ========================
26
+ // BOOT
27
+ // ========================
28
+ require("../server/server.js");
Binary file
Binary file
Binary file