create-nitro-lib
v0.5.0
Published
CLI tool to generate React Native Nitro Modules templates
Downloads
50
Maintainers
Readme
Create Nitro Lib CLI
A command-line tool to generate React Native Nitro Modules templates quickly and consistently, following industry best practices and modern tooling.
Usage
Create a new Nitro module project:
bunx create-nitro-lib my-moduleWith options:
bunx create-nitro-lib my-module --skip-installFeatures
- 🚀 Interactive project setup
- 📦 Complete project structure generation
- 🔧 TypeScript support out of the box
- 📱 Example app included
- 🏗️ Android and iOS native code structure
- 📋 Ready-to-use configuration files
Project Structure
The generated project includes:
react-native-my-module/
├── package/ # The nitro module package
│ ├── src/ # TypeScript source code with specs
│ ├── android/ # Android native implementation
│ ├── ios/ # iOS native implementation
│ ├── cpp/ # C++ shared implementation
│ └── nitro.json # Nitro configuration
├── example/ # Expo example app
├── scripts/ # Build scripts
├── package.json # Workspace configuration
├── tsconfig.json
└── README.mdDevelopment
To work on this CLI tool:
git clone <repo-url>
cd nitro-lib-template-cli
bun install
bun run build
bun linkThen you can test it locally:
create-nitro-lib test-moduleScripts
bun run build- Build the CLIbun run dev- Run in development modebun run test- Test the CLI by generating a projectbun run publish:npm- Publish to NPMbun run publish:dry- Dry run to see what will be published
Publishing
When you're ready to publish:
# Test everything works
bun run test
# Check what will be published
bun run publish:dry
# Publish to NPM (you'll need 2FA code)
bun run publish:npmLicense
MIT
