qr-secure-send 1.2.0 → 1.3.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/cli.js CHANGED
@@ -1,15 +1,18 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const { execSync } = require("child_process");
3
+ const http = require("http");
4
+ const fs = require("fs");
4
5
  const path = require("path");
5
6
 
6
- const dir = path.resolve(__dirname);
7
7
  const port = process.argv[2] || 3000;
8
+ const file = path.join(__dirname, "index.html");
9
+ const html = fs.readFileSync(file);
8
10
 
9
- console.log(`QR Secure Send running at http://localhost:${port}`);
11
+ const server = http.createServer((req, res) => {
12
+ res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
13
+ res.end(html);
14
+ });
10
15
 
11
- try {
12
- execSync(`npx serve -l ${port} "${dir}"`, { stdio: "inherit" });
13
- } catch (_) {
14
- // user pressed Ctrl+C
15
- }
16
+ server.listen(port, () => {
17
+ console.log(`QR Secure Send running at http://localhost:${port}`);
18
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qr-secure-send",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Encrypt and transfer secrets via QR code",
5
5
  "keywords": ["qr", "qrcode", "encryption", "password", "secure", "transfer"],
6
6
  "author": "",
@@ -1,12 +0,0 @@
1
- {
2
- "permissions": {
3
- "allow": [
4
- "Bash(git init:*)",
5
- "Bash(git add:*)",
6
- "Bash(git stash:*)",
7
- "Bash(chmod +x /Users/daviddayag/DEV/Personal/qr-secure-send/cli.js)",
8
- "Bash(git push:*)",
9
- "Bash(npm publish:*)"
10
- ]
11
- }
12
- }