@lunarity/nebula-fetch-cli 0.0.2

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/index.ts ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { Command } from "commander";
4
+ import chalk from "chalk";
5
+ import { downloadYoutubeAudio } from "./commands/youtube";
6
+
7
+ const program = new Command();
8
+
9
+ program
10
+ .name("nebula-fetch")
11
+ .description("CLI tool for downloading media from different platforms")
12
+ .version("1.0.0");
13
+
14
+ program
15
+ .command("youtube")
16
+ .description("Download a video from YouTube")
17
+ .argument("<url>", "URL of the video")
18
+ .option("-o, --output <path>", "Output path for the video")
19
+ .action(async (url, options) => {
20
+ try {
21
+ console.log(chalk.blue(`Downloading video from: ${url}`));
22
+ await downloadYoutubeAudio(url, options.output);
23
+ } catch (error) {
24
+ console.error(chalk.red("Error:"), error);
25
+ process.exit(1);
26
+ }
27
+ });
28
+
29
+ program.parse();
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@lunarity/nebula-fetch-cli",
3
+ "version": "0.0.2",
4
+ "module": "index.ts",
5
+ "description": "CLI tool for downloading media from different platforms",
6
+ "type": "module",
7
+ "main": "dist/index.js",
8
+ "devDependencies": {
9
+ "@types/bun": "latest"
10
+ },
11
+ "peerDependencies": {
12
+ "typescript": "^5.0.0"
13
+ },
14
+ "dependencies": {
15
+ "@ybd-project/ytdl-core": "latest",
16
+ "chalk": "^5.3.0",
17
+ "commander": "^12.1.0"
18
+ },
19
+ "bin": {
20
+ "nebula-fetch": "./dist/index.js"
21
+ },
22
+ "scripts": {
23
+ "build": "bun build ./index.ts --outdir ./dist --target node && chmod +x ./dist/index.js",
24
+ "dev": "bun index.ts",
25
+ "prepublish": "bun run build"
26
+ },
27
+ "keywords": [
28
+ "cli",
29
+ "media",
30
+ "download"
31
+ ]
32
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "compilerOptions": {
3
+ // Enable latest features
4
+ "lib": ["ESNext", "DOM"],
5
+ "target": "ESNext",
6
+ "module": "ESNext",
7
+ "moduleDetection": "force",
8
+ "jsx": "react-jsx",
9
+ "allowJs": true,
10
+
11
+ // Bundler mode
12
+ "moduleResolution": "bundler",
13
+ "allowImportingTsExtensions": true,
14
+ "verbatimModuleSyntax": true,
15
+ "noEmit": true,
16
+
17
+ // Best practices
18
+ "strict": true,
19
+ "skipLibCheck": true,
20
+ "noFallthroughCasesInSwitch": true,
21
+
22
+ // Some stricter flags (disabled by default)
23
+ "noUnusedLocals": false,
24
+ "noUnusedParameters": false,
25
+ "noPropertyAccessFromIndexSignature": false
26
+ }
27
+ }