@sefinek/google-tts-api 2.1.8 → 2.1.9
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 +6 -4
- package/dist/assertInputTypes.d.ts.map +1 -1
- package/dist/getAudioBase64.d.ts.map +1 -1
- package/dist/getAudioBase64.js +1 -1
- package/dist/getAudioUrl.d.ts.map +1 -1
- package/dist/getAudioUrl.js +2 -2
- package/dist/splitLongText.d.ts.map +1 -1
- package/eslint.config.mjs +53 -55
- package/package.json +22 -17
package/README.md
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
# 📢 Google TTS API
|
|
2
|
-
Google TTS (Text-To-Speech) for [Node.js](https://nodejs.org)
|
|
2
|
+
Google TTS (Text-To-Speech) for [Node.js](https://nodejs.org). For free without any API keys!
|
|
3
|
+
|
|
4
|
+
This is a fork of [zlargon/google-tts](https://github.com/zlargon/google-tts) with updated dependencies (the old versions had [vulnerabilities](http://github.com/zlargon/google-tts/blob/master/package.json#L27)).
|
|
3
5
|
|
|
4
6
|

|
|
5
|
-

|
|
8
|
+

|
|
7
9
|
|
|
8
10
|
|
|
9
11
|
## 📥 Installation
|
|
@@ -104,7 +106,7 @@ googleTTS
|
|
|
104
106
|
.catch(console.error);
|
|
105
107
|
```
|
|
106
108
|
|
|
107
|
-
#### [More examples](https://github.com/
|
|
109
|
+
#### [More examples](https://github.com/sefinek/google-tts-api/tree/master/example)
|
|
108
110
|
|
|
109
111
|
|
|
110
112
|
## 📑 License
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertInputTypes.d.ts","sourceRoot":"","sources":["../src/assertInputTypes.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"assertInputTypes.d.ts","sourceRoot":"","sources":["../src/assertInputTypes.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,gBAAgB,GAAI,MAAM,MAAM,EAAE,MAAM,MAAM,EAAE,MAAM,OAAO,EAAE,MAAM,MAAM,SAgBhF,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAudioBase64.d.ts","sourceRoot":"","sources":["../src/getAudioBase64.ts"],"names":[],"mappings":"AAIA,UAAU,MAAM;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAaD,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"getAudioBase64.d.ts","sourceRoot":"","sources":["../src/getAudioBase64.ts"],"names":[],"mappings":"AAIA,UAAU,MAAM;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAaD,eAAO,MAAM,cAAc,GACvB,MAAM,MAAM,EACZ,gCAAuF,MAAW,KACnG,OAAO,CAAC,MAAM,CAgDhB,CAAC;AAEF,UAAU,cAAe,SAAQ,MAAM;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAoBD,eAAO,MAAM,iBAAiB,GAC1B,MAAM,MAAM,EACZ,6CAMG,cAAmB,KACvB,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,CAyBjD,CAAC"}
|
package/dist/getAudioBase64.js
CHANGED
|
@@ -13,8 +13,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.getAllAudioBase64 = exports.getAudioBase64 = void 0;
|
|
16
|
-
const assertInputTypes_1 = __importDefault(require("./assertInputTypes"));
|
|
17
16
|
const axios_1 = __importDefault(require("axios"));
|
|
17
|
+
const assertInputTypes_1 = __importDefault(require("./assertInputTypes"));
|
|
18
18
|
const splitLongText_1 = __importDefault(require("./splitLongText"));
|
|
19
19
|
const getAudioBase64 = (text_1, ...args_1) => __awaiter(void 0, [text_1, ...args_1], void 0, function* (text, { lang = 'en', slow = false, host = 'https://translate.google.com', timeout = 10000 } = {}) {
|
|
20
20
|
(0, assertInputTypes_1.default)(text, lang, slow, host);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAudioUrl.d.ts","sourceRoot":"","sources":["../src/getAudioUrl.ts"],"names":[],"mappings":"AAIA,UAAU,MAAM;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAYD,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"getAudioUrl.d.ts","sourceRoot":"","sources":["../src/getAudioUrl.ts"],"names":[],"mappings":"AAIA,UAAU,MAAM;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAYD,eAAO,MAAM,WAAW,GACpB,MAAM,MAAM,EACZ,uBAAsE,MAAW,KAClF,MA0BF,CAAC;AAEF,UAAU,cAAe,SAAQ,MAAM;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAmBD,eAAO,MAAM,eAAe,GACxB,MAAM,MAAM,EACZ,oCAKG,cAAmB,KACvB;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EAWpC,CAAC"}
|
package/dist/getAudioUrl.js
CHANGED
|
@@ -4,9 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getAllAudioUrls = exports.getAudioUrl = void 0;
|
|
7
|
+
const node_url_1 = __importDefault(require("node:url"));
|
|
7
8
|
const assertInputTypes_1 = __importDefault(require("./assertInputTypes"));
|
|
8
9
|
const splitLongText_1 = __importDefault(require("./splitLongText"));
|
|
9
|
-
const url_1 = __importDefault(require("url"));
|
|
10
10
|
const getAudioUrl = (text, { lang = 'en', slow = false, host = 'https://translate.google.com' } = {}) => {
|
|
11
11
|
(0, assertInputTypes_1.default)(text, lang, slow, host);
|
|
12
12
|
if (text.length > 200) {
|
|
@@ -14,7 +14,7 @@ const getAudioUrl = (text, { lang = 'en', slow = false, host = 'https://translat
|
|
|
14
14
|
}
|
|
15
15
|
return (host +
|
|
16
16
|
'/translate_tts' +
|
|
17
|
-
|
|
17
|
+
node_url_1.default.format({
|
|
18
18
|
query: {
|
|
19
19
|
ie: 'UTF-8',
|
|
20
20
|
q: text,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"splitLongText.d.ts","sourceRoot":"","sources":["../src/splitLongText.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"splitLongText.d.ts","sourceRoot":"","sources":["../src/splitLongText.ts"],"names":[],"mappings":"AAGA,UAAU,MAAM;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAYD,QAAA,MAAM,aAAa,GACf,MAAM,MAAM,EACZ,4BAAsC,MAAW,KAClD,MAAM,EAmDR,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
package/eslint.config.mjs
CHANGED
|
@@ -1,56 +1,54 @@
|
|
|
1
|
-
import js from '@eslint/js';
|
|
2
|
-
import globals from 'globals';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
'
|
|
17
|
-
'comma-
|
|
18
|
-
'
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'
|
|
27
|
-
'no-
|
|
28
|
-
'no-
|
|
29
|
-
'no-
|
|
30
|
-
'no-
|
|
31
|
-
'no-
|
|
32
|
-
'no-
|
|
33
|
-
'no-
|
|
34
|
-
'no-
|
|
35
|
-
'no-
|
|
36
|
-
'no-
|
|
37
|
-
'no-
|
|
38
|
-
'
|
|
39
|
-
'
|
|
40
|
-
'
|
|
41
|
-
'
|
|
42
|
-
'
|
|
43
|
-
'
|
|
44
|
-
'
|
|
45
|
-
'space-
|
|
46
|
-
'space-
|
|
47
|
-
'space-
|
|
48
|
-
'
|
|
49
|
-
'
|
|
50
|
-
'
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
ignores: ['node_modules']
|
|
55
|
-
}
|
|
1
|
+
import js from '@eslint/js';
|
|
2
|
+
import globals from 'globals';
|
|
3
|
+
|
|
4
|
+
export default [
|
|
5
|
+
js.configs.recommended,
|
|
6
|
+
{
|
|
7
|
+
languageOptions: {
|
|
8
|
+
ecmaVersion: 'latest',
|
|
9
|
+
globals: {
|
|
10
|
+
...globals.node,
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
rules: {
|
|
14
|
+
'arrow-spacing': ['warn', { before: true, after: true }],
|
|
15
|
+
'comma-dangle': ['warn', { arrays: 'always-multiline', objects: 'always-multiline' }],
|
|
16
|
+
'comma-spacing': 'warn',
|
|
17
|
+
'comma-style': 'error',
|
|
18
|
+
'curly': ['error', 'multi-line', 'consistent'],
|
|
19
|
+
'dot-location': ['error', 'property'],
|
|
20
|
+
'handle-callback-err': 'off',
|
|
21
|
+
'indent': ['warn', 'tab'],
|
|
22
|
+
'keyword-spacing': 'warn',
|
|
23
|
+
'max-nested-callbacks': ['error', { max: 4 }],
|
|
24
|
+
'max-statements-per-line': ['error', { max: 2 }],
|
|
25
|
+
'no-console': 'off',
|
|
26
|
+
'no-empty': 'warn',
|
|
27
|
+
'no-empty-function': 'warn',
|
|
28
|
+
'no-floating-decimal': 'error',
|
|
29
|
+
'no-lonely-if': 'warn',
|
|
30
|
+
'no-multi-spaces': 'warn',
|
|
31
|
+
'no-multiple-empty-lines': ['warn', { max: 3, maxEOF: 1, maxBOF: 0 }],
|
|
32
|
+
'no-shadow': ['error', { allow: ['err', 'resolve', 'reject'] }],
|
|
33
|
+
'no-trailing-spaces': 'warn',
|
|
34
|
+
'no-unreachable': 'warn',
|
|
35
|
+
'no-unused-vars': 'warn',
|
|
36
|
+
'no-use-before-define': ['error', { functions: false, classes: true }],
|
|
37
|
+
'no-var': 'error',
|
|
38
|
+
'object-curly-spacing': ['warn', 'always'],
|
|
39
|
+
'prefer-const': 'error',
|
|
40
|
+
'quotes': ['warn', 'single'],
|
|
41
|
+
'semi': ['warn', 'always'],
|
|
42
|
+
'sort-vars': 'warn',
|
|
43
|
+
'space-before-blocks': 'warn',
|
|
44
|
+
'space-before-function-paren': ['warn', { anonymous: 'never', named: 'never', asyncArrow: 'always' }],
|
|
45
|
+
'space-in-parens': 'warn',
|
|
46
|
+
'space-infix-ops': 'warn',
|
|
47
|
+
'space-unary-ops': 'warn',
|
|
48
|
+
'spaced-comment': 'warn',
|
|
49
|
+
'wrap-regex': 'warn',
|
|
50
|
+
'yoda': 'error',
|
|
51
|
+
},
|
|
52
|
+
ignores: ['node_modules', '*min.js', '*bundle*', 'build/*', 'dist/*'],
|
|
53
|
+
},
|
|
56
54
|
];
|
package/package.json
CHANGED
|
@@ -1,32 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sefinek/google-tts-api",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.9",
|
|
4
4
|
"description": "Google TTS (Text-To-Speech) for Node.js without any vulnerabilities. For free without any API keys!",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloud",
|
|
7
|
-
"google
|
|
8
|
-
"google api",
|
|
9
|
-
"google apis client",
|
|
10
|
-
"google apis",
|
|
11
|
-
"google cloud platform",
|
|
12
|
-
"google cloud",
|
|
13
|
-
"google texttospeech",
|
|
14
|
-
"google",
|
|
7
|
+
"google-api-client",
|
|
15
8
|
"google-api",
|
|
16
|
-
"
|
|
9
|
+
"google-apis-client",
|
|
10
|
+
"google-apis",
|
|
11
|
+
"google-cloud-platform",
|
|
12
|
+
"google-cloud",
|
|
13
|
+
"google-texttospeech",
|
|
14
|
+
"google",
|
|
15
|
+
"text-to-speech-api",
|
|
17
16
|
"texttospeech"
|
|
18
17
|
],
|
|
19
|
-
"homepage": "https://github.com/
|
|
18
|
+
"homepage": "https://github.com/sefinek/google-tts-api#readme",
|
|
20
19
|
"bugs": {
|
|
21
|
-
"url": "https://github.com/
|
|
20
|
+
"url": "https://github.com/sefinek/google-tts-api/issues"
|
|
22
21
|
},
|
|
23
22
|
"repository": {
|
|
24
23
|
"type": "git",
|
|
25
|
-
"url": "git+https://github.com/
|
|
24
|
+
"url": "git+https://github.com/sefinek/google-tts-api.git"
|
|
26
25
|
},
|
|
27
26
|
"license": "MIT",
|
|
28
27
|
"author": "zlargon",
|
|
28
|
+
"type": "commonjs",
|
|
29
29
|
"main": "dist/index.js",
|
|
30
|
+
"types": "dist/index.d.ts",
|
|
31
|
+
"directories": {
|
|
32
|
+
"example": "example",
|
|
33
|
+
"test": "test"
|
|
34
|
+
},
|
|
30
35
|
"scripts": {
|
|
31
36
|
"build": "tsc -p .",
|
|
32
37
|
"cover": "npm run build && jest --coverage",
|
|
@@ -42,13 +47,13 @@
|
|
|
42
47
|
"testEnvironment": "node"
|
|
43
48
|
},
|
|
44
49
|
"dependencies": {
|
|
45
|
-
"axios": "^1.
|
|
50
|
+
"axios": "^1.9.0"
|
|
46
51
|
},
|
|
47
52
|
"devDependencies": {
|
|
48
|
-
"@eslint/js": "^9.
|
|
49
|
-
"globals": "^
|
|
53
|
+
"@eslint/js": "^9.25.1",
|
|
54
|
+
"globals": "^16.0.0",
|
|
50
55
|
"is-base64": "^1.1.0",
|
|
51
56
|
"jest": "^29.7.0",
|
|
52
|
-
"typescript": "^5.
|
|
57
|
+
"typescript": "^5.8.3"
|
|
53
58
|
}
|
|
54
59
|
}
|