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 🙏

© 2025 – Pkg Stats / Ryan Hefner

rn-cli-tool

v1.2.0

Published

A custom CLI for React Native screen and component generation

Readme

rn-cli-tool

A developer-friendly CLI tool for React Native projects using Expo Router or classic file-based navigation. This tool helps you quickly generate screen files with consistent templates and naming conventions — similar to Laravel's artisan commands.

📦 NPM: https://www.npmjs.com/package/rn-cli-tool


🚀 Features

  • Generate screens and components using a simple command
  • Supports nested paths with parentheses (for Expo Router layouts)
  • Generate .tsx files using the --tsx flag
  • Force overwrite existing files with --force flag
  • Create empty template files with --empty flag
  • Lightweight and fast — no dependencies
  • Flag support: --path, --tsx, --force, --empty, --help, --version

📆 Installation

Install it globally using npm:

npm install -g rn-cli-tool

💠 Usage

📄 Create a screen

rn create:screen <ScreenName> [options]

📄 Create a component

rn create:component <ComponentName> [options]

🔧 Available Options

| Option | Short | Description | Example | |--------|-------|-------------|---------| | --path | -p | Target directory (default: current folder) | --path "app/(auth)" | | --tsx | | Generate a .tsx file instead of .js | --tsx | | --force | -f | Overwrite if file already exists | --force | | --empty | -e | Create an empty screen/component template | --empty | | --help | -h | Show help information | --help | | --version | -v | Show version information | --version |

🧪 Examples

Create a screen in the current folder:

rn create:screen HomeScreen

Create a screen inside app/(auth) (Expo Router style):

rn create:screen LoginScreen --path "app/(auth)"

Create a screen as TypeScript:

rn create:screen SplashScreen --tsx

Create a screen with force overwrite:

rn create:screen HomeScreen --force

Create an empty screen template:

rn create:screen LoginScreen --empty

Create a component in src/components:

rn create:component Button -p src/components --tsx

Create an empty component with force overwrite:

rn create:component Button --empty --force

Show help:

rn create:screen --help

Show version:

rn --version

📁 Project Structure

You should place screen templates inside a templates folder, like:

templates/
  screen.tpl
  component.tpl
  empty.tpl

The template files use placeholders like {{screenName}} or {{componentName}}, which will be replaced automatically.

Example screen.tpl:

import React from 'react';
import { View, Text, StyleSheet } from 'react-native';

const {{screenName}} = () => {
  return (
    <View style={styles.container}>
      <Text>{{screenName}}</Text>
    </View>
  );
}

export default {{screenName}}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
  },
});

Example component.tpl:

import React from 'react';
import { View, Text, StyleSheet } from 'react-native';

const {{componentName}} = () => {
  return (
    <View style={styles.container}>
      <Text>{{componentName}}</Text>
    </View>
  );
}

export default {{componentName}};

const styles = StyleSheet.create({
  container: {
    padding: 10,
  },
});

Example empty.tpl:

import React from 'react';

const {{screenName}} = () => {
  return ();
}

export default {{screenName}}

const styles = StyleSheet.create({});

👨‍💼 Author

Ahmad Jamous Full Stack Mobile Developer — React Native & Laravel Portfolio & Projects


📄 License

This project is licensed under the MIT License. See the LICENSE file for details.


🤝 Contributing

Contributions are welcome! If you'd like to add new features (such as create:context or improved flag parsing), feel free to open an issue or pull request.

To get started:

  1. Fork the repository
  2. Clone it locally
  3. Run npm link to test your changes globally
  4. Submit a pull request with your improvements

Make sure your code is clean, well-documented, and tested. Let's make React Native development easier together!