mfe-player 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.
- package/README.md +17 -2
- package/bin/mfe.js +61 -0
- package/package.json +35 -4
package/README.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
#
|
|
1
|
+
# mfe-player
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A plugin-driven terminal music player. This package ships the launcher and
|
|
4
|
+
pulls in the right prebuilt binary for your platform; there is no install
|
|
5
|
+
script and no download at first run.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g mfe-player # also: bun add -g mfe-player
|
|
9
|
+
mfe
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
You also need **mpv** (audio), **python3** (plugins) and **yt-dlp**
|
|
13
|
+
(streaming). `mfe doctor` tells you what is missing and how to fix it.
|
|
14
|
+
|
|
15
|
+
Prefer a package manager? `cargo install mfe-player`, `pipx install
|
|
16
|
+
mfe-player`, or the install script from the repo.
|
|
17
|
+
|
|
18
|
+
MIT.
|
package/bin/mfe.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
// Thin launcher: pick the optional platform package that npm already
|
|
5
|
+
// installed for this machine and hand it the arguments. No postinstall
|
|
6
|
+
// download, no proxy surprises.
|
|
7
|
+
const path = require("node:path");
|
|
8
|
+
const { spawnSync } = require("node:child_process");
|
|
9
|
+
|
|
10
|
+
function isMusl() {
|
|
11
|
+
if (process.platform !== "linux") return false;
|
|
12
|
+
try {
|
|
13
|
+
return !process.report.getReport().header.glibcVersionRuntime;
|
|
14
|
+
} catch {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function packages() {
|
|
20
|
+
const { platform, arch } = process;
|
|
21
|
+
if (platform === "linux") {
|
|
22
|
+
const glibc = `mfe-player-linux-${arch}`;
|
|
23
|
+
return isMusl() ? [`${glibc}-musl`, glibc] : [glibc];
|
|
24
|
+
}
|
|
25
|
+
if (platform === "darwin") return [`mfe-player-darwin-${arch}`];
|
|
26
|
+
if (platform === "win32") return [`mfe-player-win32-${arch}`];
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function binary() {
|
|
31
|
+
const file = process.platform === "win32" ? "mfe-player.exe" : "mfe-player";
|
|
32
|
+
for (const name of packages()) {
|
|
33
|
+
try {
|
|
34
|
+
return require.resolve(`${name}/bin/${file}`);
|
|
35
|
+
} catch {
|
|
36
|
+
try {
|
|
37
|
+
const root = require.resolve(`${name}/package.json`);
|
|
38
|
+
return path.join(path.dirname(root), "bin", file);
|
|
39
|
+
} catch {
|
|
40
|
+
// try the next candidate
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const bin = binary();
|
|
48
|
+
if (!bin) {
|
|
49
|
+
console.error(
|
|
50
|
+
`mfe-player: no prebuilt binary for ${process.platform}-${process.arch}`,
|
|
51
|
+
);
|
|
52
|
+
console.error("install it with: cargo install mfe-player");
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const result = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
|
|
57
|
+
if (result.error) {
|
|
58
|
+
console.error(`mfe-player: ${result.error.message}`);
|
|
59
|
+
process.exit(1);
|
|
60
|
+
}
|
|
61
|
+
process.exit(result.status === null ? 1 : result.status);
|
package/package.json
CHANGED
|
@@ -1,6 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mfe-player",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "A plugin-driven terminal music player: mpv, ratatui, no subscription, no account.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/omkargs/mfe-player.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/omkargs/mfe-player",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"music",
|
|
13
|
+
"tui",
|
|
14
|
+
"terminal",
|
|
15
|
+
"player",
|
|
16
|
+
"mpv"
|
|
17
|
+
],
|
|
18
|
+
"bin": {
|
|
19
|
+
"mfe": "bin/mfe.js",
|
|
20
|
+
"mfe-player": "bin/mfe.js"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"bin/mfe.js",
|
|
24
|
+
"README.md"
|
|
25
|
+
],
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=16"
|
|
28
|
+
},
|
|
29
|
+
"optionalDependencies": {
|
|
30
|
+
"mfe-player-linux-x64": "0.2.0",
|
|
31
|
+
"mfe-player-linux-x64-musl": "0.2.0",
|
|
32
|
+
"mfe-player-linux-arm64": "0.2.0",
|
|
33
|
+
"mfe-player-darwin-x64": "0.2.0",
|
|
34
|
+
"mfe-player-darwin-arm64": "0.2.0",
|
|
35
|
+
"mfe-player-win32-x64": "0.2.0"
|
|
36
|
+
}
|
|
37
|
+
}
|