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

react-native-misaki

v1.0.0

Published

React Native bindings for Misaki English G2P using Nitro Modules with sync and async support

Downloads

402

Readme

react-native-misaki

React Native bindings for MisakiSwift, a Swift G2P (grapheme-to-phoneme) library for converting English text to IPA phonemes. Designed for text-to-speech applications such as Kokoro TTS.

Requirements

| Requirement | Details | | ---------------- | ----------------------------------- | | Platform | iOS only (physical device required) | | iOS Version | 18.0+ | | React Native | 0.75+ |

Note: This library uses a static fork of MisakiSwift which eliminates the need for use_frameworks! :linkage => :dynamic in your Podfile.

Simulator Limitation: This library uses MLX under the hood, which does not run on iOS Simulator. Testing requires a physical device.

Installation

npm install react-native-misaki react-native-nitro-modules

react-native-nitro-modules is required as this library uses Nitro Modules for native bindings.

iOS Setup

1. Set minimum deployment target to iOS 18.0

In your ios/Podfile, add or update:

platform :ios, '18.0'

2. Install pods

cd ios && pod install

No additional framework configuration is required.

Expo Setup

This library requires a development build and is not compatible with Expo Go.

1. Install dependencies

npx expo install react-native-misaki react-native-nitro-modules expo-build-properties

2. Configure app.json

Add the config plugin to set iOS 18.0 deployment target:

{
  "expo": {
    "plugins": [
      [
        "expo-build-properties",
        {
          "ios": {
            "deploymentTarget": "18.0"
          }
        }
      ]
    ]
  }
}

3. Generate native project and build

# Generate the ios folder
npx expo prebuild --platform ios --clean

# Build and run on physical device
npx expo run:ios --device

The --device flag is required as the iOS Simulator is not supported due to MLX limitations.

Usage

import { EnglishG2P } from 'react-native-misaki';

// American English (default)
const g2p = new EnglishG2P();
const result = g2p.phonemize('Hello world!');

console.log(result.phonemes);
// Output: "həlˈO wˈɜɹld!"

console.log(result.tokens);
// Output: [
//   { text: "Hello", phonemes: "həlˈO", whitespace: " ", start: undefined, end: undefined },
//   { text: "world", phonemes: "wˈɜɹld", whitespace: "", start: undefined, end: undefined },
//   { text: "!", phonemes: "!", whitespace: "", start: undefined, end: undefined }
// ]

// British English
const g2pBritish = new EnglishG2P({ british: true });
const resultBritish = g2pBritish.phonemize('Hello world!');

// Async version (runs on background thread)
const resultAsync = await g2p.phonemizeAsync('Hello world!');

API

EnglishG2P

Constructor

new EnglishG2P(options?: EnglishG2POptions)

| Option | Type | Default | Description | | --------- | --------- | ------- | --------------------------------- | | british | boolean | false | Use British English pronunciation |

Methods

| Method | Returns | Description | | ------------------------------ | -------------------------- | ------------------------------------------- | | phonemize(text: string) | PhonemizeResult | Convert text to IPA phonemes synchronously | | phonemizeAsync(text: string) | Promise<PhonemizeResult> | Convert text to IPA phonemes asynchronously |

PhonemizeResult

The result object returned by phonemize() and phonemizeAsync():

| Property | Type | Description | | ---------- | --------- | ------------------------------------------------ | | phonemes | string | The complete IPA phoneme string for the input | | tokens | Token[] | Array of tokens with individual phoneme mappings |

Token

Each token represents a word or punctuation from the input text:

| Property | Type | Description | | ------------ | --------------------- | ------------------------------------------------ | | text | string | The original text of the token | | phonemes | string \| undefined | The IPA phonemes for this token | | whitespace | string | Whitespace following this token in original text | | start | number \| undefined | Start timestamp for audio alignment (seconds) | | end | number \| undefined | End timestamp for audio alignment (seconds) |

Limitations

| Constraint | Reason | | ------------------------ | -------------------------------------------------------------- | | iOS 18.0+ only | MisakiSwift requires iOS 18 APIs | | Physical device only | MLX framework does not run on iOS Simulator | | No Android support | MisakiSwift is a Swift-only library with no Android equivalent |

Troubleshooting

App crashes on simulator

This library does not support the iOS Simulator. MLX, which powers MisakiSwift, requires Apple Silicon and does not run in the simulated environment. A physical iOS device is required for testing.

Build fails with deployment target error

Bare React Native:

Ensure your Podfile specifies iOS 18.0:

platform :ios, '18.0'

Then run pod install again.

Expo:

Ensure expo-build-properties is configured in your app.json:

{
  "expo": {
    "plugins": [
      [
        "expo-build-properties",
        {
          "ios": {
            "deploymentTarget": "18.0"
          }
        }
      ]
    ]
  }
}

Then regenerate the native project:

npx expo prebuild --platform ios --clean

Expo Go is not supported

This library includes native code and requires a development build. Expo Go cannot load native modules. Use:

npx expo run:ios --device

Code signing error

If you encounter code signing issues during development:

# Bare React Native
npx react-native run-ios -- CODE_SIGNING_ALLOWED=NO

# Expo
npx expo run:ios --device -- CODE_SIGNING_ALLOWED=NO

See IMPLEMENTATION.md for additional details.

Contributing

License

MIT


Made with create-react-native-library