@shreyash1601/oopsify 1.0.0 → 1.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/README.md CHANGED
@@ -19,7 +19,7 @@ Turn boring errors into entertaining moments 😄
19
19
  ## 📦 Installation
20
20
 
21
21
  ```bash
22
- npm install -g oopsify
22
+ npm install -g @shreyash1601/oopsify
23
23
  ```
24
24
 
25
25
  ---
package/bin/index.js CHANGED
@@ -2,13 +2,12 @@
2
2
 
3
3
  const fs = require('fs');
4
4
  const path = require('path');
5
- const player = require('node-wav-player');
5
+ const sound = require('sound-play');
6
6
  const os = require('os');
7
7
 
8
8
 
9
9
  (async () => {
10
10
  // 👉 ESM imports
11
- const inquirer = (await import('inquirer')).default;
12
11
  const chalkImport = await import('chalk');
13
12
  const chalk = new chalkImport.Chalk({ level: 3 });
14
13
 
@@ -186,13 +185,13 @@ alias run="oopsify_run"
186
185
 
187
186
  const soundPath = path.join(soundsDir, `${soundName}.wav`);
188
187
 
189
- player.play({
190
- path: soundPath,
191
- }).then(async () => {
192
-
193
- console.log('\x1b[103m\x1b[31m\x1b[1m 😵 Oops! That didn’t go as planned \x1b[0m\r\n\n');
194
- }).catch(() => {
195
- console.error(`❌ Sound "${soundName}" not found`);
196
- });
188
+ sound.play(soundPath)
189
+ .then(() => {
190
+ process.stdout.write('\n');
191
+ process.stdout.write('\x1b[103m\x1b[31m\x1b[1m 😵 Oops! That didn’t go as planned \x1b[0m\n\n');
192
+ })
193
+ .catch(() => {
194
+ console.error('⚠️ Unable to play sound on this system');
195
+ });
197
196
 
198
197
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shreyash1601/oopsify",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Play meme sounds automatically on terminal errors 🔊",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -19,10 +19,10 @@
19
19
  "dependencies": {
20
20
  "chalk": "^5.0.0",
21
21
  "enquirer": "^2.4.1",
22
- "node-wav-player": "^1.0.0"
22
+ "sound-play": "^1.1.0"
23
23
  },
24
24
  "files": [
25
25
  "bin",
26
26
  "sounds"
27
27
  ]
28
- }
28
+ }