gspeak 0.0.3 → 0.0.4

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 GlobalTechInfo
3
+ Copyright (c) 2026 Qasim Ali
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -4,11 +4,12 @@
4
4
 
5
5
  # gspeak
6
6
 
7
- **Google Text to Speech for Node.js — modern, typed, zero deprecated dependencies.**
7
+ **Google Text to Speech for Node.js**
8
8
 
9
9
  A TypeScript rewrite of [gtts](https://www.npmjs.com/package/gtts) — drop-in compatible.
10
10
 
11
11
  [![License](https://img.shields.io/npm/l/gspeak?style=flat-square&label=License&color=blue)](https://github.com/GlobalTechInfo/gspeak/blob/main/LICENSE)
12
+ [![Coverage](https://codecov.io/gh/GlobalTechInfo/gspeak/branch/main/graph/badge.svg)](https://codecov.io/gh/GlobalTechInfo/gspeak)
12
13
  [![NPM Version](https://img.shields.io/npm/v/gspeak?style=flat-square&label=Version&color=red)](https://npmjs.com/package/gspeak)
13
14
  [![Code Quality](https://img.shields.io/codefactor/grade/github/GlobalTechInfo/gspeak?style=flat-square&label=Code%20Quality)](https://www.codefactor.io/repository/github/GlobalTechInfo/gspeak)
14
15
  [![Downloads](https://img.shields.io/npm/dw/gspeak?style=flat-square&label=Downloads&color=green)](https://npmjs.com/package/gspeak)
@@ -20,10 +21,9 @@ A TypeScript rewrite of [gtts](https://www.npmjs.com/package/gtts) — drop-in c
20
21
  ## ✨ Features
21
22
 
22
23
  - 🔊 Convert any text to speech using **Google TTS**
23
- - 📦 **Zero deprecated dependencies**
24
24
  - 🔷 Full **TypeScript** support
25
25
  - 🔗 **Drop-in replacement** for `gtts`
26
- - 🌍 **60+ languages** supported
26
+ - 🌍 **81 languages** supported
27
27
  - 💾 Save to file or stream directly
28
28
  - 🖥️ **CLI** included
29
29
 
@@ -58,7 +58,7 @@ import { gSpeak } from 'gspeak' // ESM ✅
58
58
 
59
59
  const { gSpeak } = require('gspeak') // CJS ✅
60
60
 
61
- const gSpeak = require('gspeak').default // CJS ✅
61
+ const gSpeak = require('gspeak').default // CJS ✅
62
62
  ```
63
63
 
64
64
  ---
@@ -95,6 +95,19 @@ app.listen(3000, () => {
95
95
  })
96
96
  ```
97
97
 
98
+ ### List all supported languages
99
+
100
+ ```ts
101
+ import { LANGUAGES } from 'gspeak'
102
+
103
+ console.log(LANGUAGES)
104
+ // { af: 'Afrikaans', sq: 'Albanian', ... }
105
+
106
+ // or via the static getter
107
+ import { gSpeak } from 'gspeak'
108
+ console.log(gSpeak.languages)
109
+ ```
110
+
98
111
  ### Debug mode
99
112
 
100
113
  ```ts
@@ -118,18 +131,23 @@ gspeak "Hello Google Text to Speech" -l en -o /tmp/hello.mp3
118
131
 
119
132
  ---
120
133
 
121
- ## 🌍 Supported Languages
134
+ ## 🌍 Supported Languages (81 total)
122
135
 
123
136
  | Code | Language |
124
137
  |------|----------|
125
138
  | `af` | Afrikaans |
126
139
  | `sq` | Albanian |
140
+ | `am` | Amharic |
127
141
  | `ar` | Arabic |
128
- | `hy` | Armenian |
142
+ | `eu` | Basque |
143
+ | `bn` | Bengali |
144
+ | `bs` | Bosnian |
145
+ | `bg` | Bulgarian |
146
+ | `my` | Burmese |
129
147
  | `ca` | Catalan |
130
148
  | `zh` | Chinese |
131
- | `zh-cn` | Chinese (Mandarin/China) |
132
- | `zh-tw` | Chinese (Mandarin/Taiwan) |
149
+ | `zh-cn` | Chinese (Simplified) |
150
+ | `zh-tw` | Chinese (Traditional) |
133
151
  | `zh-yue` | Chinese (Cantonese) |
134
152
  | `hr` | Croatian |
135
153
  | `cs` | Czech |
@@ -137,43 +155,67 @@ gspeak "Hello Google Text to Speech" -l en -o /tmp/hello.mp3
137
155
  | `nl` | Dutch |
138
156
  | `en` | English |
139
157
  | `en-au` | English (Australia) |
158
+ | `en-ca` | English (Canada) |
159
+ | `en-in` | English (India) |
160
+ | `en-ie` | English (Ireland) |
140
161
  | `en-uk` | English (United Kingdom) |
141
162
  | `en-us` | English (United States) |
142
- | `eo` | Esperanto |
163
+ | `en-za` | English (South Africa) |
164
+ | `et` | Estonian |
165
+ | `fil` | Filipino |
143
166
  | `fi` | Finnish |
144
167
  | `fr` | French |
168
+ | `fr-ca` | French (Canada) |
169
+ | `fr-fr` | French (France) |
170
+ | `gl` | Galician |
145
171
  | `de` | German |
146
172
  | `el` | Greek |
147
- | `ht` | Haitian Creole |
173
+ | `gu` | Gujarati |
174
+ | `ha` | Hausa |
175
+ | `iw` | Hebrew |
148
176
  | `hi` | Hindi |
149
177
  | `hu` | Hungarian |
150
178
  | `is` | Icelandic |
151
179
  | `id` | Indonesian |
152
180
  | `it` | Italian |
153
181
  | `ja` | Japanese |
182
+ | `jw` | Javanese |
183
+ | `kn` | Kannada |
184
+ | `km` | Khmer |
154
185
  | `ko` | Korean |
155
186
  | `la` | Latin |
156
187
  | `lv` | Latvian |
157
- | `mk` | Macedonian |
188
+ | `lt` | Lithuanian |
189
+ | `ms` | Malay |
190
+ | `ml` | Malayalam |
191
+ | `mr` | Marathi |
192
+ | `ne` | Nepali |
158
193
  | `no` | Norwegian |
159
194
  | `pl` | Polish |
160
195
  | `pt` | Portuguese |
161
196
  | `pt-br` | Portuguese (Brazil) |
197
+ | `pt-pt` | Portuguese (Portugal) |
198
+ | `pa` | Punjabi |
162
199
  | `ro` | Romanian |
163
200
  | `ru` | Russian |
164
201
  | `sr` | Serbian |
202
+ | `si` | Sinhala |
165
203
  | `sk` | Slovak |
166
204
  | `es` | Spanish |
167
205
  | `es-es` | Spanish (Spain) |
168
206
  | `es-us` | Spanish (United States) |
207
+ | `su` | Sundanese |
169
208
  | `sw` | Swahili |
170
209
  | `sv` | Swedish |
210
+ | `tl` | Tagalog |
171
211
  | `ta` | Tamil |
212
+ | `te` | Telugu |
172
213
  | `th` | Thai |
173
214
  | `tr` | Turkish |
215
+ | `uk` | Ukrainian |
216
+ | `ur` | Urdu |
174
217
  | `vi` | Vietnamese |
175
218
  | `cy` | Welsh |
176
-
177
219
  ---
178
220
 
179
221
  ## 🔄 Migrating from `gtts`
@@ -205,4 +247,3 @@ MIT © [Qasim Ali](https://github.com/GlobalTechInfo)
205
247
  Made with ❤️ — Thanks for using **gspeak**!
206
248
 
207
249
  </div>
208
-
@@ -1,20 +1,87 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const LANGUAGES = {
4
- 'af': 'Afrikaans', 'sq': 'Albanian', 'ar': 'Arabic', 'hy': 'Armenian',
5
- 'ca': 'Catalan', 'zh': 'Chinese', 'zh-cn': 'Chinese (Mandarin/China)',
6
- 'zh-tw': 'Chinese (Mandarin/Taiwan)', 'zh-yue': 'Chinese (Cantonese)',
7
- 'hr': 'Croatian', 'cs': 'Czech', 'da': 'Danish', 'nl': 'Dutch',
8
- 'en': 'English', 'en-au': 'English (Australia)', 'en-uk': 'English (United Kingdom)',
9
- 'en-us': 'English (United States)', 'eo': 'Esperanto', 'fi': 'Finnish',
10
- 'fr': 'French', 'de': 'German', 'el': 'Greek', 'ht': 'Haitian Creole',
11
- 'hi': 'Hindi', 'hu': 'Hungarian', 'is': 'Icelandic', 'id': 'Indonesian',
12
- 'it': 'Italian', 'ja': 'Japanese', 'ko': 'Korean', 'la': 'Latin',
13
- 'lv': 'Latvian', 'mk': 'Macedonian', 'no': 'Norwegian', 'pl': 'Polish',
14
- 'pt': 'Portuguese', 'pt-br': 'Portuguese (Brazil)', 'ro': 'Romanian',
15
- 'ru': 'Russian', 'sr': 'Serbian', 'sk': 'Slovak', 'es': 'Spanish',
16
- 'es-es': 'Spanish (Spain)', 'es-us': 'Spanish (United States)',
17
- 'sw': 'Swahili', 'sv': 'Swedish', 'ta': 'Tamil', 'th': 'Thai',
18
- 'tr': 'Turkish', 'vi': 'Vietnamese', 'cy': 'Welsh'
4
+ 'af': 'Afrikaans',
5
+ 'sq': 'Albanian',
6
+ 'am': 'Amharic',
7
+ 'ar': 'Arabic',
8
+ 'eu': 'Basque',
9
+ 'bn': 'Bengali',
10
+ 'bs': 'Bosnian',
11
+ 'bg': 'Bulgarian',
12
+ 'my': 'Burmese',
13
+ 'ca': 'Catalan',
14
+ 'zh': 'Chinese',
15
+ 'zh-yue': 'Chinese (Cantonese)',
16
+ 'zh-hk': 'Chinese (Cantonese, Hong Kong)',
17
+ 'zh-cn': 'Chinese (Simplified)',
18
+ 'zh-tw': 'Chinese (Traditional)',
19
+ 'hr': 'Croatian',
20
+ 'cs': 'Czech',
21
+ 'da': 'Danish',
22
+ 'nl': 'Dutch',
23
+ 'en': 'English',
24
+ 'en-au': 'English (Australia)',
25
+ 'en-ca': 'English (Canada)',
26
+ 'en-in': 'English (India)',
27
+ 'en-ie': 'English (Ireland)',
28
+ 'en-za': 'English (South Africa)',
29
+ 'en-uk': 'English (United Kingdom)',
30
+ 'en-us': 'English (United States)',
31
+ 'et': 'Estonian',
32
+ 'fil': 'Filipino',
33
+ 'fi': 'Finnish',
34
+ 'fr': 'French',
35
+ 'fr-ca': 'French (Canada)',
36
+ 'fr-fr': 'French (France)',
37
+ 'gl': 'Galician',
38
+ 'de': 'German',
39
+ 'el': 'Greek',
40
+ 'gu': 'Gujarati',
41
+ 'ha': 'Hausa',
42
+ 'iw': 'Hebrew',
43
+ 'hi': 'Hindi',
44
+ 'hu': 'Hungarian',
45
+ 'is': 'Icelandic',
46
+ 'id': 'Indonesian',
47
+ 'it': 'Italian',
48
+ 'ja': 'Japanese',
49
+ 'jw': 'Javanese',
50
+ 'kn': 'Kannada',
51
+ 'km': 'Khmer',
52
+ 'ko': 'Korean',
53
+ 'la': 'Latin',
54
+ 'lv': 'Latvian',
55
+ 'lt': 'Lithuanian',
56
+ 'ms': 'Malay',
57
+ 'ml': 'Malayalam',
58
+ 'mr': 'Marathi',
59
+ 'ne': 'Nepali',
60
+ 'no': 'Norwegian',
61
+ 'pl': 'Polish',
62
+ 'pt': 'Portuguese',
63
+ 'pt-br': 'Portuguese (Brazil)',
64
+ 'pt-pt': 'Portuguese (Portugal)',
65
+ 'pa': 'Punjabi',
66
+ 'ro': 'Romanian',
67
+ 'ru': 'Russian',
68
+ 'sr': 'Serbian',
69
+ 'si': 'Sinhala',
70
+ 'sk': 'Slovak',
71
+ 'es': 'Spanish',
72
+ 'es-es': 'Spanish (Spain)',
73
+ 'es-us': 'Spanish (United States)',
74
+ 'su': 'Sundanese',
75
+ 'sw': 'Swahili',
76
+ 'sv': 'Swedish',
77
+ 'tl': 'Tagalog',
78
+ 'ta': 'Tamil',
79
+ 'te': 'Telugu',
80
+ 'th': 'Thai',
81
+ 'tr': 'Turkish',
82
+ 'uk': 'Ukrainian',
83
+ 'ur': 'Urdu',
84
+ 'vi': 'Vietnamese',
85
+ 'cy': 'Welsh',
19
86
  };
20
87
  exports.default = LANGUAGES;
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "gspeak",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "Google Text to Speech — a modern TypeScript rewrite of gtts with zero deprecated dependencies",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
7
7
  "bin": {
8
- "gspeak": "dist/bin/gspeak.js"
8
+ "gspeak": "./dist/bin/gspeak.js"
9
9
  },
10
10
  "files": [
11
11
  "dist"
@@ -15,7 +15,9 @@
15
15
  "build": "tsc -p .",
16
16
  "prepublishOnly": "npm run build",
17
17
  "lint": "eslint src/**/*.ts bin/**/*.ts",
18
- "test": "mocha --timeout 30000 -r ts-node/register \"tests/**/*.test.ts\""
18
+ "test": "vitest run",
19
+ "test:coverage": "vitest run --coverage",
20
+ "verify": "npm run build && npx ts-node verify-languages.ts"
19
21
  },
20
22
  "keywords": [
21
23
  "google",
@@ -34,17 +36,16 @@
34
36
  "yargs": "^18.0.0"
35
37
  },
36
38
  "devDependencies": {
37
- "@types/mocha": "^10.0.0",
38
39
  "@types/node": "^22.0.0",
39
40
  "@types/yargs": "^17.0.0",
40
41
  "@typescript-eslint/eslint-plugin": "^8.0.0",
41
42
  "@typescript-eslint/parser": "^8.0.0",
43
+ "@vitest/coverage-v8": "^4.1.0",
42
44
  "eslint": "^9.0.0",
43
- "mocha": "^11.0.0",
44
45
  "rimraf": "^6.0.0",
45
- "ts-node": "^10.9.2",
46
46
  "typescript": "^5.0.0",
47
- "typescript-eslint": "^8.0.0"
47
+ "typescript-eslint": "^8.0.0",
48
+ "vitest": "^4.1.0"
48
49
  },
49
50
  "publishConfig": {
50
51
  "provenance": true
@@ -56,5 +57,26 @@
56
57
  "bugs": {
57
58
  "url": "https://github.com/GlobalTechInfo/gspeak/issues"
58
59
  },
59
- "homepage": "https://github.com/GlobalTechInfo/gspeak#readme"
60
+ "homepage": "https://github.com/GlobalTechInfo/gspeak#readme",
61
+ "vitest": {
62
+ "coverage": {
63
+ "provider": "v8",
64
+ "include": [
65
+ "src/**/*.ts"
66
+ ],
67
+ "exclude": [
68
+ "src/index.ts"
69
+ ],
70
+ "reporter": [
71
+ "text",
72
+ "html"
73
+ ],
74
+ "thresholds": {
75
+ "lines": 100,
76
+ "functions": 100,
77
+ "branches": 100,
78
+ "statements": 100
79
+ }
80
+ }
81
+ }
60
82
  }