mevebu 0.0.0-stage → 0.1.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 +21 -0
- package/README.md +65 -2
- package/bin/mevebu.js +115 -0
- package/mevebu/app/mevebu.css +1162 -0
- package/mevebu/app/mevebu.js +730 -0
- package/mevebu/favicon-64.png +0 -0
- package/mevebu/icon.png +0 -0
- package/mevebu/index.html +21 -0
- package/mevebu/libs/css/tools.css +155 -0
- package/mevebu/libs/js/core.js +593 -0
- package/mevebu/libs/js/icons.js +88 -0
- package/mevebu/libs/js/registry.js +328 -0
- package/mevebu/libs/js/router.js +55 -0
- package/mevebu/libs/js/tools/base64.js +61 -0
- package/mevebu/libs/js/tools/case-converter.js +79 -0
- package/mevebu/libs/js/tools/coin-flip.js +57 -0
- package/mevebu/libs/js/tools/color-converter.js +146 -0
- package/mevebu/libs/js/tools/dice-roller.js +59 -0
- package/mevebu/libs/js/tools/fake-data.js +107 -0
- package/mevebu/libs/js/tools/hash-generator.js +56 -0
- package/mevebu/libs/js/tools/jwt-generator.js +111 -0
- package/mevebu/libs/js/tools/lorem-ipsum.js +92 -0
- package/mevebu/libs/js/tools/name-picker.js +69 -0
- package/mevebu/libs/js/tools/password-generator.js +90 -0
- package/mevebu/libs/js/tools/qr-generator.js +97 -0
- package/mevebu/libs/js/tools/qr-scanner.js +190 -0
- package/mevebu/libs/js/tools/spin-wheel.js +154 -0
- package/mevebu/libs/js/tools/url-encoder.js +47 -0
- package/mevebu/libs/js/tools/uuid-generator.js +74 -0
- package/mevebu/libs/js/vendor/jsQR.js +10102 -0
- package/mevebu/libs/js/vendor/qrcode-generator.mjs +2237 -0
- package/package.json +47 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 mevebu
|
|
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
CHANGED
|
@@ -1,3 +1,66 @@
|
|
|
1
|
-
#
|
|
1
|
+
# mevebu
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Small tools that run in your browser. No accounts, no uploads, no tracking.
|
|
4
|
+
|
|
5
|
+
mevebu is a set of tiny, privacy-first utilities served from your own machine. Every tool runs
|
|
6
|
+
entirely in the tab, so nothing you paste ever leaves your computer.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
npm install -g mevebu
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Use
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
mevebu
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The tools open in your default browser. Press `Ctrl+C` in the terminal to stop.
|
|
21
|
+
|
|
22
|
+
### Options
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
-p, --port <number> Port to listen on. Defaults to a free port.
|
|
26
|
+
-d, --dir <path> Folder to serve. Defaults to the bundled tools.
|
|
27
|
+
--no-open Do not open the browser.
|
|
28
|
+
-v, --version Print the version and exit.
|
|
29
|
+
-h, --help Print this help and exit.
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Tools
|
|
33
|
+
|
|
34
|
+
16 tools, each with its own page. Most update as you type, with no submit button.
|
|
35
|
+
|
|
36
|
+
| Category | Tools |
|
|
37
|
+
| :--- | :--- |
|
|
38
|
+
| Random | Spin the Wheel, Name Picker, Coin Flip, Dice Roller |
|
|
39
|
+
| Passwords and keys | Password Generator, JWT Generator, Hash Generator |
|
|
40
|
+
| Developer | UUID Generator, Color Converter |
|
|
41
|
+
| Convert | Base64, URL Encoder, Case Converter |
|
|
42
|
+
| Text and data | Lorem Ipsum, Test Data |
|
|
43
|
+
| QR codes | QR Generator, QR Scanner |
|
|
44
|
+
|
|
45
|
+
## Development
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
npm run dev # serve on http://localhost:5173
|
|
49
|
+
npm run icons # regenerate vendored lucide icons
|
|
50
|
+
npm run ship # bump version, commit, tag, push, and publish to npm
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Release
|
|
54
|
+
|
|
55
|
+
`npm run ship` walks through a release: it asks for an update message, lets you pick a patch,
|
|
56
|
+
minor, or major bump, then commits, tags, pushes, and publishes to npm.
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
npm run ship # interactive
|
|
60
|
+
npm run ship -- "fix qr size" minor
|
|
61
|
+
npm run ship -- "release" patch -y # non-interactive
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## License
|
|
65
|
+
|
|
66
|
+
MIT
|
package/bin/mevebu.js
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// mevebu. Serves the mevebu/ folder on localhost with Node built-ins only,
|
|
3
|
+
// prints the address, and opens the default browser.
|
|
4
|
+
//
|
|
5
|
+
// Usage: mevebu [--port 8080] [--no-open] [--dir ./mevebu]
|
|
6
|
+
// mevebu --version
|
|
7
|
+
|
|
8
|
+
import { createServer } from "node:http";
|
|
9
|
+
import { readFile, stat } from "node:fs/promises";
|
|
10
|
+
import { createReadStream } from "node:fs";
|
|
11
|
+
import { join, extname, resolve, normalize } from "node:path";
|
|
12
|
+
import { fileURLToPath } from "node:url";
|
|
13
|
+
import { dirname } from "node:path";
|
|
14
|
+
import { exec } from "node:child_process";
|
|
15
|
+
|
|
16
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
17
|
+
const DEFAULT_DIR = resolve(here, "..", "mevebu");
|
|
18
|
+
|
|
19
|
+
// The version lives in package.json; keep one source of truth.
|
|
20
|
+
const pkg = JSON.parse(await readFile(resolve(here, "..", "package.json"), "utf8"));
|
|
21
|
+
const VERSION = pkg.version;
|
|
22
|
+
|
|
23
|
+
const HELP = `mevebu ${VERSION}
|
|
24
|
+
|
|
25
|
+
Serve the offline tools on localhost. No accounts, no uploads, no tracking.
|
|
26
|
+
|
|
27
|
+
Usage:
|
|
28
|
+
mevebu [options]
|
|
29
|
+
|
|
30
|
+
Options:
|
|
31
|
+
-p, --port <number> Port to listen on. Defaults to a free port.
|
|
32
|
+
-d, --dir <path> Folder to serve. Defaults to the bundled tools.
|
|
33
|
+
--no-open Do not open the browser.
|
|
34
|
+
-v, --version Print the version and exit.
|
|
35
|
+
-h, --help Print this help and exit.`;
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
const TYPES = {
|
|
39
|
+
".html": "text/html; charset=utf-8",
|
|
40
|
+
".css": "text/css; charset=utf-8",
|
|
41
|
+
".js": "text/javascript; charset=utf-8",
|
|
42
|
+
".mjs": "text/javascript; charset=utf-8",
|
|
43
|
+
".json": "application/json; charset=utf-8",
|
|
44
|
+
".svg": "image/svg+xml",
|
|
45
|
+
".png": "image/png",
|
|
46
|
+
".ico": "image/x-icon",
|
|
47
|
+
".txt": "text/plain; charset=utf-8",
|
|
48
|
+
".woff2": "font/woff2",
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
function args(argv) {
|
|
52
|
+
const out = { port: 0, open: true, dir: DEFAULT_DIR };
|
|
53
|
+
for (let i = 2; i < argv.length; i++) {
|
|
54
|
+
const flag = argv[i];
|
|
55
|
+
if (flag === "--no-open") out.open = false;
|
|
56
|
+
else if ((flag === "--port" || flag === "-p") && argv[i + 1]) out.port = Number(argv[++i]);
|
|
57
|
+
else if ((flag === "--dir" || flag === "-d") && argv[i + 1]) out.dir = resolve(argv[++i]);
|
|
58
|
+
else if (flag === "--version" || flag === "-v" || flag === "version") {
|
|
59
|
+
console.log(VERSION);
|
|
60
|
+
process.exit(0);
|
|
61
|
+
} else if (flag === "--help" || flag === "-h" || flag === "help") {
|
|
62
|
+
console.log(HELP);
|
|
63
|
+
process.exit(0);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return out;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function openBrowser(url) {
|
|
70
|
+
const start = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
|
|
71
|
+
exec(`${start} "${url}"`, (error) => {
|
|
72
|
+
if (error) console.log(`Open this in your browser: ${url}`);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const options = args(process.argv);
|
|
77
|
+
const root = resolve(options.dir);
|
|
78
|
+
|
|
79
|
+
const server = createServer(async (req, res) => {
|
|
80
|
+
try {
|
|
81
|
+
const url = new URL(req.url, "http://localhost");
|
|
82
|
+
let path = normalize(decodeURIComponent(url.pathname)).replace(/^[/\\]+/, "");
|
|
83
|
+
if (!path || path.endsWith("/")) path += "index.html";
|
|
84
|
+
const file = join(root, path);
|
|
85
|
+
if (!file.startsWith(root)) {
|
|
86
|
+
res.writeHead(403);
|
|
87
|
+
res.end("Forbidden");
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const info = await stat(file).catch(() => null);
|
|
91
|
+
if (!info || !info.isFile()) {
|
|
92
|
+
res.writeHead(404, { "Content-Type": "text/plain; charset=utf-8" });
|
|
93
|
+
res.end("Not found");
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (info.size > 8 * 1024 * 1024) {
|
|
97
|
+
const body = await readFile(file);
|
|
98
|
+
res.writeHead(200, { "Content-Type": TYPES[extname(file).toLowerCase()] ?? "application/octet-stream" });
|
|
99
|
+
res.end(body);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
res.writeHead(200, { "Content-Type": TYPES[extname(file).toLowerCase()] ?? "application/octet-stream" });
|
|
103
|
+
createReadStream(file).pipe(res);
|
|
104
|
+
} catch {
|
|
105
|
+
res.writeHead(500, { "Content-Type": "text/plain; charset=utf-8" });
|
|
106
|
+
res.end("Server error");
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
server.listen(options.port || 0, "127.0.0.1", () => {
|
|
111
|
+
const { port } = server.address();
|
|
112
|
+
const url = `http://localhost:${port}/`;
|
|
113
|
+
console.log(`\n mevebu is running at ${url}\n Press Ctrl+C to stop.\n`);
|
|
114
|
+
if (options.open) openBrowser(url);
|
|
115
|
+
});
|