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

ionic-to-rn

v1.1.0

Published

CLI tool to convert Angular/Ionic components to React Native/Expo

Readme

ionic-to-rn

CLI tool to convert Angular/Ionic components to React Native/Expo components using Google Gemini AI.

Features

  • Converts Angular/Ionic components to React Native/Expo
  • Separates styles into dedicated StyleSheet files
  • Powered by Google Gemini AI for intelligent conversion
  • Validates converted components
  • Encrypted API key storage
  • Configurable component, dependency, and icon mappings
  • Supports custom output directories
  • Visual component tree display

Installation

npm install -g ionic-to-rn

Prerequisites

Usage

Navigate to your Angular/Ionic project directory and run:

ionic-to-rn

Or using npx:

npx ionic-to-rn

First Time Setup

  1. The CLI will create a .ionic-to-rn.config.json file in your project directory
  2. You'll be prompted to enter your Gemini API key
  3. The key is encrypted and saved for future use

Main Menu Options

  • Convert Component: Scan and convert Angular components to React Native
  • Validate Converted Components: Check syntax and structure of converted files
  • Change Gemini API Key: Update your Gemini API key
  • Exit: Close the CLI

Configuration

The .ionic-to-rn.config.json file allows customization:

{
  "geminiApiKey": "encrypted-key",
  "outputDir": "./converted",
  "outputMode": "same-directory",
  "componentMappings": {
    "ion-button": "TouchableOpacity",
    "ion-content": "ScrollView"
  },
  "dependencyMappings": {
    "@angular/common/http": "axios",
    "@capacitor/camera": "expo-camera"
  },
  "icons": {
    "library": "react-icons/fa",
    "mappings": {
      "add": "FaPlus",
      "arrow-back": "FaArrowLeft"
    }
  },
  "codeStyle": {
    "interfacePrefix": "I",
    "componentType": "React.FC",
    "strictMode": true
  }
}

Output

For each converted component, two files are created:

  • ComponentName.tsx - React Native component
  • ComponentName.styles.ts - StyleSheet with all styles

Conversion Rules

Component Mappings

| Ionic Component | React Native Equivalent | |----------------|------------------------| | ion-button | TouchableOpacity | | ion-content | ScrollView | | ion-input | TextInput | | ion-text | Text | | ion-card | View | | ion-list | FlatList |

Dependency Mappings

| Angular/Capacitor | React Native/Expo | |------------------|-------------------| | @angular/common/http | axios | | @capacitor/camera | expo-camera | | @capacitor/storage | @react-native-async-storage/async-storage |

Style Conversion

SCSS/CSS is converted to React Native StyleSheet:

// SCSS
.container {
  background-color: #fff;
  padding: 10px 20px;
}

Becomes:

// React Native
const styles = StyleSheet.create({
  container: {
    backgroundColor: '#fff',
    paddingVertical: 10,
    paddingHorizontal: 20
  }
});

Validation

The validator checks:

  • React imports present
  • Component typed as React.FC
  • Export statements exist
  • Style files match imports
  • StyleSheet.create() usage
  • Basic syntax validation

Partial Outputs

If conversion fails or is incomplete, partial output is saved as ComponentName.partial.txt for debugging.

Development

# Clone repository
git clone https://github.com/L1malucas/ionic-to-rn.git

# Install dependencies
npm install

# Run locally
npm start

Troubleshooting

API Key Issues

  • Verify your Gemini API key at Google AI Studio
  • Delete .ionic-to-rn.config.json and re-enter the key

No Components Found

  • Ensure you're in the correct directory
  • Components must follow Angular naming: *.page.ts, *.page.html

Conversion Errors

  • Check internet connection
  • Review partial output files for errors
  • Verify component files are readable

License

MIT

Contributing

Contributions welcome! Please open an issue or submit a PR.

Support

For issues and questions, please open an issue on GitHub.