marknest 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/bin/marknest +58 -0
- package/package.json +31 -0
package/bin/marknest
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { execFileSync } = require("child_process");
|
|
4
|
+
const { existsSync } = require("fs");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
|
|
7
|
+
const PLATFORMS = {
|
|
8
|
+
"darwin-arm64": "marknest-darwin-arm64",
|
|
9
|
+
"darwin-x64": "marknest-darwin-x64",
|
|
10
|
+
"linux-x64": "marknest-linux-x64",
|
|
11
|
+
"linux-arm64": "marknest-linux-arm64",
|
|
12
|
+
"win32-x64": "marknest-win32-x64",
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
function getBinaryPath() {
|
|
16
|
+
const platformKey = `${process.platform}-${process.arch}`;
|
|
17
|
+
const packageName = PLATFORMS[platformKey];
|
|
18
|
+
|
|
19
|
+
if (!packageName) {
|
|
20
|
+
throw new Error(
|
|
21
|
+
`Unsupported platform: ${platformKey}. ` +
|
|
22
|
+
`Supported: ${Object.keys(PLATFORMS).join(", ")}`
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const binaryName = process.platform === "win32" ? "marknest.exe" : "marknest";
|
|
27
|
+
|
|
28
|
+
// Try to resolve from node_modules (installed as optionalDependency)
|
|
29
|
+
try {
|
|
30
|
+
const packageDir = path.dirname(require.resolve(`${packageName}/package.json`));
|
|
31
|
+
const binaryPath = path.join(packageDir, "bin", binaryName);
|
|
32
|
+
if (existsSync(binaryPath)) {
|
|
33
|
+
return binaryPath;
|
|
34
|
+
}
|
|
35
|
+
} catch {
|
|
36
|
+
// Package not installed
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
throw new Error(
|
|
40
|
+
`Could not find marknest binary for ${platformKey}. ` +
|
|
41
|
+
`Please make sure ${packageName} is installed.\n` +
|
|
42
|
+
`Try: npm install ${packageName}`
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
try {
|
|
47
|
+
const binaryPath = getBinaryPath();
|
|
48
|
+
const result = execFileSync(binaryPath, process.argv.slice(2), {
|
|
49
|
+
stdio: "inherit",
|
|
50
|
+
env: process.env,
|
|
51
|
+
});
|
|
52
|
+
} catch (error) {
|
|
53
|
+
if (error.status !== undefined) {
|
|
54
|
+
process.exit(error.status);
|
|
55
|
+
}
|
|
56
|
+
console.error(error.message);
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "marknest",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Markdown workspace analyzer and PDF converter",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/developer0hye/marknest"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/developer0hye/marknest",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"markdown",
|
|
13
|
+
"pdf",
|
|
14
|
+
"converter",
|
|
15
|
+
"documentation",
|
|
16
|
+
"cli"
|
|
17
|
+
],
|
|
18
|
+
"bin": {
|
|
19
|
+
"marknest": "bin/marknest"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"bin"
|
|
23
|
+
],
|
|
24
|
+
"optionalDependencies": {
|
|
25
|
+
"marknest-darwin-arm64": "0.1.0",
|
|
26
|
+
"marknest-darwin-x64": "0.1.0",
|
|
27
|
+
"marknest-linux-x64": "0.1.0",
|
|
28
|
+
"marknest-linux-arm64": "0.1.0",
|
|
29
|
+
"marknest-win32-x64": "0.1.0"
|
|
30
|
+
}
|
|
31
|
+
}
|