@obedience-corp/peep 0.0.0-stage → 0.2.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/LICENSE +21 -0
  2. package/README.md +20 -2
  3. package/package.json +28 -4
  4. package/peep.cjs +41 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Lance Rogers
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,21 @@
1
- # Temporary Holding Version
1
+ # peep
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Your files. In focus. Browse files, preview images and video, listen to music and audiobooks, and read Markdown, source code, and Mermaid diagrams in your terminal.
4
+
5
+ ```sh
6
+ npm install -g @obedience-corp/peep
7
+ peep ~/Pictures
8
+ peep --doctor
9
+ ```
10
+
11
+ macOS and Linux on x64 and arm64 are supported. The matching native executable is installed through npm's optional platform dependencies. No Go compiler, postinstall download, Node-based diagram renderer, or separate Mermaid helper is needed. Node is used only to launch the Go executable.
12
+
13
+ For media playback, install FFmpeg and mpv separately:
14
+
15
+ - macOS: `brew install ffmpeg mpv`
16
+ - Arch Linux: `sudo pacman -S ffmpeg mpv`
17
+ - Debian/Ubuntu: `sudo apt install ffmpeg mpv`
18
+
19
+ `peep --doctor` reports missing tools. Documents and Mermaid work without them. Native image quality requires a Kitty-graphics-compatible terminal; other terminals use color-cell previews.
20
+
21
+ [Source and full guide](https://github.com/lancekrogers/peep)
package/package.json CHANGED
@@ -1,6 +1,30 @@
1
1
  {
2
+ "bin": {
3
+ "peep": "peep.cjs"
4
+ },
5
+ "description": "Terminal file explorer with image, video, music, Markdown and Mermaid previews",
6
+ "engines": {
7
+ "node": "\u003e=22"
8
+ },
9
+ "files": [
10
+ "peep.cjs",
11
+ "LICENSE"
12
+ ],
13
+ "homepage": "https://github.com/lancekrogers/peep",
14
+ "license": "MIT",
2
15
  "name": "@obedience-corp/peep",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
16
+ "optionalDependencies": {
17
+ "@obedience-corp/peep-darwin-arm64": "0.2.0",
18
+ "@obedience-corp/peep-darwin-x64": "0.2.0",
19
+ "@obedience-corp/peep-linux-arm64": "0.2.0",
20
+ "@obedience-corp/peep-linux-x64": "0.2.0"
21
+ },
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/lancekrogers/peep.git"
28
+ },
29
+ "version": "0.2.0"
30
+ }
package/peep.cjs ADDED
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const { spawn } = require('node:child_process');
5
+ const path = require('node:path');
6
+ const metadata = require('./package.json');
7
+ const target = `${process.platform}-${process.arch}`;
8
+ const packageName = `${metadata.name}-${target}`;
9
+ if (!Object.hasOwn(metadata.optionalDependencies, packageName)) {
10
+ console.error(`peep: unsupported platform ${target}; supported: macOS/Linux on x64 and arm64.`);
11
+ process.exit(1);
12
+ }
13
+ let executable;
14
+ try {
15
+ executable = require.resolve(`${packageName}/bin/peep`);
16
+ } catch {
17
+ console.error(`peep: missing ${packageName}@${metadata.version}. Reinstall with npm install -g ${metadata.name} --include=optional.`);
18
+ process.exit(1);
19
+ }
20
+ // Inherit the actual terminal, including stdin, so peep owns its TUI normally.
21
+ // Forward termination signals and wait for peep to restore the terminal.
22
+ const child = spawn(executable, process.argv.slice(2), { stdio: 'inherit' });
23
+ const handlers = new Map();
24
+ for (const signal of ['SIGINT', 'SIGTERM', 'SIGHUP']) {
25
+ const handler = () => child.kill(signal);
26
+ handlers.set(signal, handler);
27
+ process.on(signal, handler);
28
+ }
29
+ const cleanup = () => {
30
+ for (const [signal, handler] of handlers) process.removeListener(signal, handler);
31
+ };
32
+ child.on('error', error => {
33
+ cleanup();
34
+ console.error(`peep: cannot launch ${path.basename(executable)}: ${error.message}`);
35
+ process.exitCode = 1;
36
+ });
37
+ child.on('exit', (code, signal) => {
38
+ cleanup();
39
+ if (signal) process.kill(process.pid, signal);
40
+ else process.exitCode = code ?? 1;
41
+ });