npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

gspeak

v0.0.4

Published

Google Text to Speech — a modern TypeScript rewrite of gtts with zero deprecated dependencies

Downloads

236,834

Readme

gspeak

Google Text to Speech for Node.js

A TypeScript rewrite of gtts — drop-in compatible.

License Coverage NPM Version Code Quality Downloads


✨ Features

  • 🔊 Convert any text to speech using Google TTS
  • 🔷 Full TypeScript support
  • 🔗 Drop-in replacement for gtts
  • 🌍 81 languages supported
  • 💾 Save to file or stream directly
  • 🖥️ CLI included

📦 Installation

npm i gspeak

🚀 Quick Start

import { gSpeak } from 'gspeak'

const tts = new gSpeak('Hello world', 'en')
tts.save('/tmp/hello.mp3', (err) => {
  if (err) throw err
  console.log('Saved to /tmp/hello.mp3')
})

📥 Import

import { gSpeak } from 'gspeak'         // ESM ✅

const { gSpeak } = require('gspeak')     // CJS ✅

const gSpeak = require('gspeak').default   // CJS ✅

📖 Usage

Save to file

import { gSpeak } from 'gspeak'

const tts = new gSpeak('Text to speak', 'en')
tts.save('/tmp/output.mp3', (err) => {
  if (err) throw err
  console.log('Done!')
})

Stream (e.g. with Express)

import express from 'express'
import { gSpeak } from 'gspeak'

const app = express()

app.get('/speak', (req, res) => {
  const tts = new gSpeak(req.query.text as string, req.query.lang as string)
  tts.stream().pipe(res)
})

app.listen(3000, () => {
  console.log('http://localhost:3000/speak?lang=en&text=Hello')
})

List all supported languages

import { LANGUAGES } from 'gspeak'

console.log(LANGUAGES)
// { af: 'Afrikaans', sq: 'Albanian', ... }

// or via the static getter
import { gSpeak } from 'gspeak'
console.log(gSpeak.languages)

Debug mode

const tts = new gSpeak('Hello', 'en', true) // 3rd param enables debug logging

🖥️ CLI

npm install -g gspeak
gspeak "Hello Google Text to Speech" -l en -o /tmp/hello.mp3

| Flag | Alias | Description | |------|-------|-------------| | --language | -l | Language code (default: en) | | --output | -o | Output file path (required) | | --verbose | -v | Print debug messages |


🌍 Supported Languages (81 total)

| Code | Language | |------|----------| | af | Afrikaans | | sq | Albanian | | am | Amharic | | ar | Arabic | | eu | Basque | | bn | Bengali | | bs | Bosnian | | bg | Bulgarian | | my | Burmese | | ca | Catalan | | zh | Chinese | | zh-cn | Chinese (Simplified) | | zh-tw | Chinese (Traditional) | | zh-yue | Chinese (Cantonese) | | hr | Croatian | | cs | Czech | | da | Danish | | nl | Dutch | | en | English | | en-au | English (Australia) | | en-ca | English (Canada) | | en-in | English (India) | | en-ie | English (Ireland) | | en-uk | English (United Kingdom) | | en-us | English (United States) | | en-za | English (South Africa) | | et | Estonian | | fil | Filipino | | fi | Finnish | | fr | French | | fr-ca | French (Canada) | | fr-fr | French (France) | | gl | Galician | | de | German | | el | Greek | | gu | Gujarati | | ha | Hausa | | iw | Hebrew | | hi | Hindi | | hu | Hungarian | | is | Icelandic | | id | Indonesian | | it | Italian | | ja | Japanese | | jw | Javanese | | kn | Kannada | | km | Khmer | | ko | Korean | | la | Latin | | lv | Latvian | | lt | Lithuanian | | ms | Malay | | ml | Malayalam | | mr | Marathi | | ne | Nepali | | no | Norwegian | | pl | Polish | | pt | Portuguese | | pt-br | Portuguese (Brazil) | | pt-pt | Portuguese (Portugal) | | pa | Punjabi | | ro | Romanian | | ru | Russian | | sr | Serbian | | si | Sinhala | | sk | Slovak | | es | Spanish | | es-es | Spanish (Spain) | | es-us | Spanish (United States) | | su | Sundanese | | sw | Swahili | | sv | Swedish | | tl | Tagalog | | ta | Tamil | | te | Telugu | | th | Thai | | tr | Turkish | | uk | Ukrainian | | ur | Urdu | | vi | Vietnamese | | cy | Welsh |

🔄 Migrating from gtts

gspeak is a drop-in replacement. Just change the import:

// before
const gTTS = require('gtts')
const tts = new gTTS('Hello', 'en')

// after
const { gSpeak } = require('gspeak')
const tts = new gSpeak('Hello', 'en')

Same constructor, same .save(), same .stream() — nothing else changes.


📄 License

MIT © Qasim Ali


Made with ❤️ — Thanks for using gspeak!