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

@nammayatri/react-native-tts

v0.1.0

Published

Text-to-speech for React Native on iOS and Android. Maintained fork in the spirit of ak1394/react-native-tts.

Readme

@nammayatri/react-native-tts

Text-to-speech for React Native, iOS and Android. A maintained, TypeScript-first re-implementation inspired by react-native-tts (MIT, no longer actively maintained).

  • Android: Kotlin module backed by android.speech.tts.TextToSpeech
  • iOS: Swift module backed by AVSpeechSynthesizer
  • Works on both the legacy bridge and the New Architecture (TurboModule interop)
  • Strict TypeScript types for every method and event

Installation

yarn add @nammayatri/react-native-tts
# or
npm install @nammayatri/react-native-tts

Then on iOS:

cd ios && pod install

No autolinking changes are required on RN 0.60+.

iOS Swift setup note

This package ships Swift code. If your app does not already use Swift, add an empty Swift file (e.g. Dummy.swift) to your Xcode project so Xcode generates the Swift runtime header for you. You should not need a bridging header.

If you see build errors about React not being found, ensure your Podfile uses modular headers or add:

use_modular_headers!

or, more narrowly:

pod 'React-Core', :modular_headers => true

Quick start

import Tts from '@nammayatri/react-native-tts';

await Tts.getInitStatus();

await Tts.setDefaultLanguage('en-IN');
await Tts.setDefaultRate(0.5); // 0..1, remapped per-platform
await Tts.setDefaultPitch(1.0);

const utteranceId = await Tts.speak('Your cab is arriving.');

API

All methods return a Promise. Values that aren't supported on a given platform resolve to a neutral value (false, 'not-supported', or []) rather than throwing, so cross-platform code can call them unconditionally.

| Method | iOS | Android | Notes | | --- | :-: | :-: | --- | | getInitStatus() | ✅ | ✅ | Resolves once the engine is ready. | | speak(utterance, options?) | ✅ | ✅ | Resolves with an utteranceId string. | | stop(onWordBoundary?) | ✅ | ✅ | | | pause(onWordBoundary?) | ✅ | ❌ | Resolves false on Android. | | resume() | ✅ | ❌ | Resolves false on Android. | | setDefaultLanguage(lang) | ✅ | ✅ | BCP-47 tag (e.g. 'en-IN'). | | setDefaultVoice(voiceId) | ✅ | ✅ | Use an id from voices(). | | setDefaultRate(rate, skipTransform?) | ✅ | ✅ | rate in 0..1; iOS remaps to AVSpeech range unless skipTransform. | | setDefaultPitch(pitch) | ✅ | ✅ | Clamped to 0.5..2.0 on iOS. | | setDucking(enabled) | ✅ | ❌ | | | setIgnoreSilentSwitch(mode) | ✅ | ❌ | 'inherit' \| 'ignore' \| 'obey'. | | voices() | ✅ | ✅ | | | engines() | ❌ | ✅ | | | setDefaultEngine(name) | ❌ | ✅ | Call getInitStatus() afterwards. | | requestInstallEngine() | ❌ | ✅ | Opens Play Store. | | requestInstallData() | ❌ | ✅ | |

Events

const sub = Tts.addEventListener('tts-progress', (e) => {
  // e: { utteranceId, start, end, length }
});
sub.remove();

| Event | Payload | | --- | --- | | tts-start | { utteranceId } | | tts-finish | { utteranceId } | | tts-cancel | { utteranceId } | | tts-progress | { utteranceId, start, end, length } | | tts-error | { utteranceId, error? } | | tts-pause (iOS) | { utteranceId } | | tts-resume (iOS) | { utteranceId } |

SpeakOptions

Tts.speak('Hello', {
  iosVoiceId: 'com.apple.voice.compact.en-GB.Daniel',
  rate: 0.55,
  androidParams: {
    KEY_PARAM_PAN: 0,
    KEY_PARAM_VOLUME: 1,
    KEY_PARAM_STREAM: 'STREAM_MUSIC',
  },
});

License

MIT. See LICENSE. Based in spirit on react-native-tts by Anton Krasovsky; this is an independent re-implementation and not an official fork.