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

rn-version-sync

v0.1.3

Published

Fast and simple utility to sync React Native version with native code

Readme

rn-version-sync

Fast and simple utility to sync React Native version with native code (Android and iOS).

ci

Features

  • Simple & Fast: Minimal dependencies, quick execution
  • Auto-detection: Automatically finds Android and iOS files
  • Smart Updates: Only modifies version-related lines in native files
  • Deterministic Version Codes: Calculates version codes from semver
  • npm Integration: Designed to work seamlessly with npm version lifecycle
  • Zero Config: Works out of the box with standard React Native projects

What It Does

  • Syncs package.json version → Android versionName
  • Calculates and sets Android versionCode using formula: 10000*major + 100*minor + patch
  • Syncs package.json version → iOS MARKETING_VERSION (version name)
  • Calculates and sets iOS CURRENT_PROJECT_VERSION (version code)
  • Example: version 1.2.3 produces version code 10203

Installation & Usage

Option 1: One-off execution with npx

npx rn-version-sync

Option 2: Install as dev dependency

npm install --save-dev rn-version-sync
# or
yarn add -D rn-version-sync

Add to your package.json:

{
  "scripts": {
    "version": "rn-version-sync && git add -u"
  }
}

Now when you run:

npm version patch
npm version minor
npm version major

Your native Android and iOS versions will automatically sync!

Options

Verbose mode - See detailed output:

npx rn-version-sync --verbose

Override version code - Manually specify version code:

npx rn-version-sync --version-code 42

By default, version code is calculated from semver. Use this option if you need a specific version code that doesn't follow the formula.

Requirements

  • Node.js >= 14
  • Standard React Native project structure:
    • package.json in project root
    • Android: android/app/build.gradle
    • iOS: ios/<ProjectName>.xcodeproj/project.pbxproj

Example

Given a package.json with version 1.2.3:

Android build.gradle will be updated:

versionName "1.2.3"
versionCode 10203

iOS project.pbxproj will be updated:

MARKETING_VERSION = 1.2.3;
CURRENT_PROJECT_VERSION = 10203;

Version code calculation: 10000*1 + 100*2 + 3 = 10203

Version Code Formula

The version code is automatically calculated from semver using the formula:

versionCode = 10000 * major + 100 * minor + patch

Examples:

  • 1.0.010000
  • 1.2.310203
  • 2.5.1020510
  • 12.34.56123456

This ensures:

  • Deterministic builds: Same version always produces same version code
  • Proper ordering: Higher versions always have higher codes
  • Cross-platform consistency: Android and iOS use identical codes

If you need a custom version code, use the --version-code flag.

Similar tools

License

MIT