@purpleproser/soundboard-downloader-cli 1.0.0 → 1.1.1
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 +24 -21
- package/dist/main.js +15 -2
- package/dist/main.js.map +1 -1
- package/package.json +1 -2
- package/resident-evil-2-remake-cofre-portatil.mp3 +0 -0
package/README.md
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
# @purpleproser/soundboard-downloader-cli
|
|
2
2
|
|
|
3
|
-
A command-line tool to download soundboard sounds from MyInstants.
|
|
3
|
+
A Node.js command-line tool to download soundboard sounds from [MyInstants](https://myinstants.com).
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
**📦️ npm package**: `@purpleproser/soundboard-downloader-cli`
|
|
6
|
+
|
|
7
|
+
**GitHub Repository**: [blacksagres/soundboard-downloader-cli](https://github.com/blacksagres/soundboard-downloader-cli)
|
|
7
8
|
|
|
8
9
|
## Features
|
|
9
10
|
|
|
10
11
|
- 🔍 Search for sounds by name using interactive prompts
|
|
11
12
|
- 🎵 Preview sounds by playing them in your browser
|
|
12
|
-
-
|
|
13
|
+
- 📁 Downloads are saved directly in your current working directory
|
|
13
14
|
- ✨ Simple and easy-to-use interactive interface
|
|
14
15
|
|
|
15
16
|
## Tech Stack
|
|
16
17
|
|
|
17
|
-
- **TypeScript** - Type-safe development
|
|
18
|
-
- **Node.js** - Runtime environment
|
|
19
18
|
- **Inquirer** - Interactive CLI prompts
|
|
20
19
|
- **jsdom** - HTML parsing and DOM manipulation
|
|
21
20
|
- **ora** - Elegant terminal spinners
|
|
22
|
-
- **open** - Opens URLs in the user's browser
|
|
21
|
+
- **open** - Opens URLs in the user's browser to allow previewing the sound
|
|
23
22
|
|
|
24
23
|
## Prerequisites
|
|
25
24
|
|
|
@@ -64,6 +63,7 @@ npm link
|
|
|
64
63
|
**Note**: This package uses the `@purpleproser` npm scope (my npm username) while the GitHub repository remains under `blacksagres`. Make sure to include the `@purpleproser/` prefix when installing!
|
|
65
64
|
|
|
66
65
|
**For Developers**: If you fork this project and want to publish your own version, either:
|
|
66
|
+
|
|
67
67
|
1. Use a different package name, or
|
|
68
68
|
2. Create your own npm scope and update the package name, or
|
|
69
69
|
3. Add `"publishConfig": { "access": "public" }` to your package.json
|
|
@@ -106,7 +106,7 @@ The CLI will guide you through an interactive process:
|
|
|
106
106
|
|
|
107
107
|
1. **Search**: You'll be prompted to enter what sound effects you're looking for
|
|
108
108
|
2. **Select**: Choose from the list of matching sounds
|
|
109
|
-
3. **Action**: Decide whether to play the sound in your browser or download it to your
|
|
109
|
+
3. **Action**: Decide whether to play the sound in your browser or download it to your **current working directory**
|
|
110
110
|
|
|
111
111
|
### Example Workflow
|
|
112
112
|
|
|
@@ -127,18 +127,6 @@ $ npm start
|
|
|
127
127
|
|
|
128
128
|
## Development
|
|
129
129
|
|
|
130
|
-
### Project Structure
|
|
131
|
-
|
|
132
|
-
```
|
|
133
|
-
src/
|
|
134
|
-
├── main.ts # Entry point
|
|
135
|
-
├── api/
|
|
136
|
-
│ └── my-instants.api.ts # API layer for MyInstants
|
|
137
|
-
├── components/ # CLI components
|
|
138
|
-
└── service/
|
|
139
|
-
└── my-instants.service.ts # Business logic
|
|
140
|
-
```
|
|
141
|
-
|
|
142
130
|
### Available Scripts
|
|
143
131
|
|
|
144
132
|
- `npm start` - Run in development mode with ts-node
|
|
@@ -147,7 +135,22 @@ src/
|
|
|
147
135
|
|
|
148
136
|
### Download Location
|
|
149
137
|
|
|
150
|
-
Downloaded sounds are saved
|
|
138
|
+
Downloaded sounds are saved directly in your current working directory. For example:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# If you run from /home/user/projects/
|
|
142
|
+
cd /home/user/projects/
|
|
143
|
+
soundboard-downloader
|
|
144
|
+
# Downloads will be saved to: /home/user/projects/wilhelm-scream.mp3
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**Tip**: Create a dedicated directory for your downloads:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
mkdir my-sounds && cd my-sounds
|
|
151
|
+
soundboard-downloader
|
|
152
|
+
# All downloads will appear in the my-sounds directory
|
|
153
|
+
```
|
|
151
154
|
|
|
152
155
|
## Contributing
|
|
153
156
|
|
package/dist/main.js
CHANGED
|
@@ -6,9 +6,20 @@ const ora_1 = require("ora");
|
|
|
6
6
|
const prompts_1 = require("@inquirer/prompts");
|
|
7
7
|
const open_1 = require("open");
|
|
8
8
|
const file_downloader_service_1 = require("./service/file-downloader.service");
|
|
9
|
+
process.on("uncaughtException", (error) => {
|
|
10
|
+
if (error instanceof Error && error.name === "ExitPromptError") {
|
|
11
|
+
console.log("👋 until next time!");
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
// Rethrow unknown errors
|
|
15
|
+
throw error;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
9
18
|
(async function () {
|
|
10
19
|
const answer = await (0, prompts_1.input)({
|
|
11
20
|
message: "What sound effects are you looking for?",
|
|
21
|
+
required: true,
|
|
22
|
+
default: "wilhelm scream",
|
|
12
23
|
});
|
|
13
24
|
const spinner = (0, ora_1.default)({
|
|
14
25
|
text: "Loading result...",
|
|
@@ -18,7 +29,8 @@ const file_downloader_service_1 = require("./service/file-downloader.service");
|
|
|
18
29
|
const sounds = await (0, my_instants_service_1.getSoundNodes)(answer);
|
|
19
30
|
spinner.stop();
|
|
20
31
|
const selection = await (0, prompts_1.select)({
|
|
21
|
-
message: "Which one to download?",
|
|
32
|
+
message: "Which one to download? (use the keyboard arrows to navigate, search for something directly)",
|
|
33
|
+
pageSize: 30,
|
|
22
34
|
choices: sounds.map((sound) => ({
|
|
23
35
|
name: sound.label,
|
|
24
36
|
value: `${sound.label}||${sound.download_url}`,
|
|
@@ -52,8 +64,9 @@ const file_downloader_service_1 = require("./service/file-downloader.service");
|
|
|
52
64
|
spinner: "growHorizontal",
|
|
53
65
|
}).start();
|
|
54
66
|
const downloadFileName = downloadUrl.split("/").pop();
|
|
67
|
+
// Download directly to current working directory
|
|
55
68
|
(0, file_downloader_service_1.downloadFile)(downloadUrl, {
|
|
56
|
-
destination:
|
|
69
|
+
destination: downloadFileName,
|
|
57
70
|
onStart: () => downloadSpinner.start(),
|
|
58
71
|
onFinish: () => downloadSpinner.stop(),
|
|
59
72
|
});
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;;AAEA,uEAA8D;AAC9D,6BAAsB;AACtB,+CAAkD;AAClD,+BAAwB;AACxB,+EAAiE;AAEjE,CAAC,KAAK;IACJ,MAAM,MAAM,GAAG,MAAM,IAAA,eAAK,EAAC;QACzB,OAAO,EAAE,yCAAyC;
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;;AAEA,uEAA8D;AAC9D,6BAAsB;AACtB,+CAAkD;AAClD,+BAAwB;AACxB,+EAAiE;AAEjE,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE;IACxC,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;QAC/D,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;IACrC,CAAC;SAAM,CAAC;QACN,yBAAyB;QACzB,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,CAAC,KAAK;IACJ,MAAM,MAAM,GAAG,MAAM,IAAA,eAAK,EAAC;QACzB,OAAO,EAAE,yCAAyC;QAClD,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,gBAAgB;KAC1B,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,IAAA,aAAG,EAAC;QAClB,IAAI,EAAE,mBAAmB;QACzB,KAAK,EAAE,SAAS;QAChB,OAAO,EAAE,cAAc;KACxB,CAAC,CAAC,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AEX,MAAM,gBAAgB,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;QAEtD,iDAAiD;QACjD,IAAA,sCAAY,EAAC,WAAW,EAAE;YACxB,WAAW,EAAE,gBAAiB;YAC9B,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE;YACtC,QAAQ,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,IAAI,EAAE;SACvC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@purpleproser/soundboard-downloader-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Easily download sounds from myinstants.com using this interactive CLI tool",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
"homepage": "https://github.com/blacksagres/soundboard-downloader-cli#readme",
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/jsdom": "^27.0.0",
|
|
40
|
-
"@types/node": "^25.2.3",
|
|
41
40
|
"ts-node": "^10.9.2",
|
|
42
41
|
"typescript": "^5.9.3"
|
|
43
42
|
},
|
|
Binary file
|