Create Kokoro TTS JavaScript library (#3)

* Set up JS project

* Finalise JS library

* Update README

* Fix package.json repository url

* Rename package -> `kokoro-js`

* Fix samples in README

* Cleanup README

* Bump `phonemizer` version

* Create web demo

* Run prettier

* Link to model used in demo

* Enable multithreading in HF space demo (~40% faster)

* Add link to demo in README

* Bump to v1.0.1
This commit is contained in:
Joshua Lochner
2025-01-16 19:50:34 +02:00
committed by GitHub
parent 757c80cc5b
commit 0a1dc5750c
37 changed files with 8820 additions and 0 deletions

65
kokoro.js/package.json Normal file
View File

@@ -0,0 +1,65 @@
{
"name": "kokoro-js",
"version": "1.0.1",
"type": "module",
"exports": {
"types": "./types/kokoro.d.ts",
"node": {
"import": "./dist/kokoro.js",
"require": "./dist/kokoro.cjs"
},
"default": "./dist/kokoro.web.js"
},
"scripts": {
"build": "rm -rf dist types && rollup -c && tsc && cp ../LICENSE LICENSE",
"format": "prettier --write . --print-width 1000",
"test": "vitest"
},
"keywords": [
"kokoro",
"tts",
"text-to-speech"
],
"author": {
"name": "hexgrad",
"email": "hello@hexgrad.com"
},
"browser": {
"path": false,
"fs/promises": false
},
"contributors": [
"Xenova"
],
"license": "Apache-2.0",
"description": "High-quality text-to-speech for the web",
"dependencies": {
"@huggingface/transformers": "^3.3.1",
"phonemizer": "^1.2.1"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^16.0.0",
"@rollup/plugin-terser": "^0.4.4",
"prettier": "3.4.2",
"rollup": "^4.30.1",
"typescript": "^5.7.3",
"vitest": "^2.1.8"
},
"files": [
"types",
"dist",
"voices",
"README.md",
"LICENSE"
],
"homepage": "https://github.com/hexgrad/kokoro",
"repository": {
"type": "git",
"url": "git+https://github.com/hexgrad/kokoro.git"
},
"publishConfig": {
"access": "public"
},
"jsdelivr": "./dist/kokoro.web.js",
"unpkg": "./dist/kokoro.web.js"
}