@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 CHANGED
@@ -1,9 +1,11 @@
1
1
  # 📢 Google TTS API
2
- Google TTS (Text-To-Speech) for [Node.js](https://nodejs.org) without any vulnerabilities. For free without any API keys!
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
  ![@sefinek/google-tts-api.png](https://img.shields.io/npm/dt/@sefinek/google-tts-api?maxAge=3600)
5
- ![@sefinek/google-tts-api.png](https://img.shields.io/github/last-commit/sefinek24/google-tts-api)
6
- ![@sefinek/google-tts-api.png](https://img.shields.io/github/languages/code-size/sefinek24/google-tts-api)
7
+ ![@sefinek/google-tts-api.png](https://img.shields.io/github/last-commit/sefinek/google-tts-api)
8
+ ![@sefinek/google-tts-api.png](https://img.shields.io/github/languages/code-size/sefinek/google-tts-api)
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/sefinek24/google-tts-api/tree/master/example)
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,SAAU,MAAM,QAAQ,MAAM,QAAQ,OAAO,QAAQ,MAAM,SAgBhF,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
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,SACjB,MAAM,kCAC2E,MAAM,KAC9F,OAAO,CAAC,MAAM,CAgDhB,CAAC;AAEF,UAAU,cAAe,SAAQ,MAAM;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAoBD,eAAO,MAAM,iBAAiB,SACpB,MAAM,+CAOT,cAAc,KAClB,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,CAyBjD,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"}
@@ -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,SACd,MAAM,yBAC0D,MAAM,KAC7E,MA0BF,CAAC;AAEF,UAAU,cAAe,SAAQ,MAAM;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAmBD,eAAO,MAAM,eAAe,SAClB,MAAM,sCAMT,cAAc,KAClB;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EAWpC,CAAC"}
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"}
@@ -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
- url_1.default.format({
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":"AAMA,UAAU,MAAM;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAYD,QAAA,MAAM,aAAa,SACT,MAAM,8BAC0B,MAAM,KAC7C,MAAM,EAmDR,CAAC;AAEF,eAAe,aAAa,CAAC"}
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
- // noinspection JSUnusedGlobalSymbols
5
- export default [
6
- js.configs.recommended,
7
- {
8
- languageOptions: {
9
- ecmaVersion: 2024,
10
- globals: {
11
- ...globals.node,
12
- ...globals.es2024
13
- }
14
- },
15
- rules: {
16
- 'arrow-spacing': ['warn', { before: true, after: true }],
17
- 'comma-dangle': ['error'],
18
- 'comma-spacing': 'error',
19
- 'comma-style': 'error',
20
- 'curly': ['error', 'multi-line', 'consistent'],
21
- 'dot-location': ['error', 'property'],
22
- 'handle-callback-err': 'off',
23
- 'indent': ['warn', 'tab'],
24
- 'keyword-spacing': 'warn',
25
- 'max-nested-callbacks': ['error', { max: 4 }],
26
- 'max-statements-per-line': ['error', { max: 2 }],
27
- 'no-console': 'off',
28
- 'no-empty': 'warn',
29
- 'no-empty-function': 'error',
30
- 'no-floating-decimal': 'error',
31
- 'no-lonely-if': 'error',
32
- 'no-multi-spaces': 'warn',
33
- 'no-multiple-empty-lines': ['warn', { max: 4, maxEOF: 1, maxBOF: 0 }],
34
- 'no-shadow': ['error', { allow: ['err', 'resolve', 'reject'] }],
35
- 'no-trailing-spaces': ['warn'],
36
- 'no-unreachable': 'warn',
37
- 'no-unused-vars': 'warn',
38
- 'no-use-before-define': ['error', { functions: false, classes: true }],
39
- 'no-var': 'error',
40
- 'object-curly-spacing': ['error', 'always'],
41
- 'prefer-const': 'error',
42
- 'quotes': ['warn', 'single'],
43
- 'semi': ['warn', 'always'],
44
- 'sort-vars': 'warn',
45
- 'space-before-blocks': 'error',
46
- 'space-before-function-paren': ['error', { anonymous: 'never', named: 'never', asyncArrow: 'always' }],
47
- 'space-in-parens': 'error',
48
- 'space-infix-ops': 'error',
49
- 'space-unary-ops': 'error',
50
- 'spaced-comment': 'warn',
51
- 'wrap-regex': 'error',
52
- 'yoda': 'error'
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.8",
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 api client",
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
- "text-to-speech api",
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/sefinek24/google-tts-api#readme",
18
+ "homepage": "https://github.com/sefinek/google-tts-api#readme",
20
19
  "bugs": {
21
- "url": "https://github.com/sefinek24/google-tts-api/issues"
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/sefinek24/google-tts-api.git"
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.7.7"
50
+ "axios": "^1.9.0"
46
51
  },
47
52
  "devDependencies": {
48
- "@eslint/js": "^9.10.0",
49
- "globals": "^15.9.0",
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.6.2"
57
+ "typescript": "^5.8.3"
53
58
  }
54
59
  }