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

rnutils

v0.4.2

Published

Command line utilities for creating common react native patterns.

Readme

React Native Utils

I found myself writing the same things over and over again, as we always do. I looked for a generator or some project scaffolding tools that would do what I wanted and as usual didn't find them. I probably could have put this in slush but I just wanted to get something done rather than learning yet another tool, even if it is simple.

rnutils is a command line utility to help create the basic patterns that I use when working on react native projects and initialize them with the create-react-native-app utility. I typically use the following tools and libraries:

  • TypeScript
  • StoryBook
  • Jest
  • Mobx

This is intended for use with vscode, but most features should be editor independent. Setting up debugging will not work with any other editor.

Since I use typescript extensively, I have not included any options for generating files in JavaScript. If I get enough interest I'll add some options for use with JS as well. PR's are welcome.

Installation

yarn global add rnutils

New Project

To get started on a new typescript project:

  1. Run create-react-native-app [projectName] as you normally would.
  2. Navigate to your new project directory and run rnutils.
  3. Choose Post CRNA Config to setup a basic typescript/react native project. See the options below for more detail.

or

  1. Run 'react-native init [projectName]` as you normally would.
  2. Navigate to your new project directory and run rnutils.
  3. Choose Post react-native Typescript Config to setup a basic typescript/react native project. See the options below for more detail.

Usage

From your project directory:

rnutils 

Options

When running the rnutils you will have the following choices:

  • Create Component
  • Create Stateless Component
  • Create Screen
  • Post CRNA Typescript Config
  • Post react-native Typescript Config
  • Exit

Create Component

This command will create a component at the /components/ComponentName directory along with four files:

  • Component.ts
  • IComponentProps.ts
  • IComponentState.ts
  • index.ts

The files will contain basic boilerplate and the index.ts will take care of exporting each file. You can include subdirectories in the component name. The first letter of the component name will be capatilazed

Create Stateless Component

This command will create a stateless component at the /components/ComponentName directory along with three files:

  • Component.ts
  • IComponentProps.ts
  • index.ts

The files will contain basic boilerplate and the index.ts will take care of exporting each file.

Create Screen

This command will create a component at the /screens/ScreenName directory along with four files:

  • Screen.ts
  • IScreenProps.ts
  • IScreenState.ts
  • index.ts

The files will contain basic boilerplate and the index.ts will take care of exporting each file.

Post CRNA TypeScript Config

This option performs a series of tasks that are meant to be completed right after you run the create-react-native-app. They are:

  • Install the following dev dependencies:

    • typescript
    • jest-expo-ts
    • react-test-renderer
    • react-native-typescript-transformer
    • @types/react
    • @types/react-native
    • @typesreact-test-renderer
    • @types/jest
  • Install the following dependencies:

    • mobx
    • mobx-react
  • Update app.json for typescript.

    • The app.json file needs to be aware of the react-native-typescript-transformer. It will be modified accordingly.
  • Create tsconfig.json.

  • Delete jsconfig.json.

  • Create .vscode/settings.json.

    • Creates the file. It will overwrite anything already there.
    • This is necesary for vscode to debug.
  • Create additonal scripts in the package.json file:

    • cleanWatchman: Deletes all inotify watches
    • startEmulator: Starts the Android emulator. This may be different on other machines.
    • preandroid: Runs before android to clean inotify watches and starts the emulator.
    • increaseWatches: Increases the number of inotify watches. This is reset on reboot. I should probably make this permanent on my machine instead of having the script here.
  • Creates my Standard Directory Structure:

    .
    ├──__tests__
    |  ├──components
    |  ├──config
    |  ├──navigation
    |  ├──screens
    |  ├──stores
    |  └──util
    └──src
        ├──components
        ├──config
        ├──navigation
        ├──screens
        ├──stores
        └──util
  • Runs getstorybook. Tests to see if a user has @storybook/cli installed. See the storybook quick start guide for more info.

Post react-native Typescript Config

This option performs a series of tasks that are meant to be completed right after you run the react-native init. They are:

  • Install the following dev dependencies:

    • typescript,
    • ts-jest,
    • react-native-typescript-transformer,
    • babel-preset-es2015,
    • @types/react,
    • @types/react-native,
    • @types/react-test-renderer,
    • @types/jest,
    • @storybook/react-native
  • Install the following dependencies:

    • mobx
    • mobx-react
  • Create rn-cli.config.json to configure the react-native-typescript-transformer

  • Create tsconfig.json.

  • Delete jsconfig.json.

  • Creates .vscode/launch.json to enable debugging.

  • Create additonal scripts in the package.json file:

    • android: Packages and installs on your connected android device or emulator.
    • ios: Packages and installs on your connected ios device or emulator.
    • cleanWatchman: Deletes all inotify watches
    • startEmulator: Starts the Android emulator. This may be different on other machines.
    • increaseWatches: Increases the number of inotify watches. This is reset on reboot. I should probably make this permanent on my machine instead of having the script here.
  • Creates my Standard Directory Structure:

    .
    ├──__tests__
    |  ├──components
    |  ├──config
    |  ├──navigation
    |  ├──screens
    |  ├──stores
    |  └──util
    └──src
        ├──components
        ├──config
        ├──navigation
        ├──screens
        ├──stores
        └──util
  • Runs getstorybook. Tests to see if a user has @storybook/cli installed. See the storybook quick start guide for more info.

NOTE I am only testing on linux/ubuntu. Most of these options should work on windows as I'm using shelljs and fs for any file access. I'm happy to accept a PR to fix any windows bugs you may have found.