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

react-native-rs-lib

v2.0.0

Published

A comprehensive React Native library with native modules for date picker, image picker, document picker, device info, location, encryption, and media processing

Readme

React Native RS Lib

A comprehensive React Native library with native modules for date picker, image picker, document picker, device info, location, encryption, and media processing.

Features

  • 📅 Date Picker - Native date/time picker with customizable options
  • 🖼️ Image Picker - Pick images from gallery or camera with editing options
  • 📹 Video Picker - Pick videos from gallery with quality options
  • 📄 Document Picker - Pick documents from device storage
  • 📱 Device Info - Get comprehensive device information
  • 📍 Location Services - Get current location with high accuracy
  • 🔐 Encryption/Decryption - AES encryption with various algorithms
  • 📄 Base64 Conversion - Convert files, images, and videos to base64
  • 🗜️ Compression - Compress images and videos
  • 🖼️ Photo Merging - Merge two photos with blend modes
  • 🎛️ Present Controller - Present custom controllers
  • Permission Management - Handle all required permissions

Installation

npm install react-native-rs-lib
# or
yarn add react-native-rs-lib

Auto-Linking Setup

This library supports React Native auto-linking (0.60+). No manual configuration is required!

Prerequisites

  • React Native 0.80 or higher
  • iOS 12.0 or higher
  • Android API level 21 or higher
  • @react-native-community/cli (for auto-linking)

Required Dependencies

Before installing this library, ensure you have the required CLI:

# Install React Native CLI (if not already installed)
npm install -g @react-native-community/cli

# Or add as dev dependency to your project
yarn add -D @react-native-community/cli

iOS Setup

The library will automatically link with your iOS project. Just run:

cd ios
pod install
cd ..
npx react-native run-ios

Required Permissions - Add to ios/YourApp/Info.plist:

<key>NSLocationWhenInUseUsageDescription</key>
<string>This app needs access to location when open.</string>
<key>NSCameraUsageDescription</key>
<string>This app needs access to camera to take photos.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app needs access to photo library to select images.</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app needs access to microphone to record videos.</string>

Android Setup

The library will automatically link with your Android project. Just run:

npx react-native run-android

Required Permissions - Add to android/app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />

Troubleshooting

Common Issues

1. CocoaPods Auto-linking Error:

[!] The command: 'node -e process.argv=['', '', 'config'];require('@react-native-community/cli').run()' returned a status code of 1

Solution:

# Install the required CLI
yarn add -D @react-native-community/cli

# Clean and reinstall pods
cd ios
rm -rf Pods Podfile.lock
pod install
cd ..

2. Auto-linking not working:

  • Check React Native version (0.60+)
  • Ensure @react-native-community/cli is installed
  • Clean Metro cache: npx react-native start --reset-cache

Manual Setup (if auto-linking fails)

If auto-linking doesn't work, see MANUAL_INSTALLATION.md for step-by-step manual setup instructions.

Pod Installation Issues

If you're having trouble with pod install, see our comprehensive POD_INSTALLATION_TROUBLESHOOTING.md guide.

CLI Dependency Issues

If you're getting CLI dependency errors, see our SIMPLE_INSTALLATION.md for the simplified approach that matches popular libraries like react-native-device-info.

Quick Fix for Auto-linking Issues:

# Install required CLI
yarn add -D @react-native-community/cli

# Clean and reinstall
cd ios
rm -rf Pods Podfile.lock
pod install
cd ..

Usage

Date Picker

import RsLib from 'react-native-rs-lib';

// Show date picker
const result = await RsLib.showDatePicker({
  mode: 'date', // 'date', 'time', 'datetime'
  title: 'Select Date',
  confirmText: 'Confirm',
  cancelText: 'Cancel',
  minimumDate: new Date('2020-01-01'),
  maximumDate: new Date('2030-12-31')
});

if (result.success) {
  console.log('Selected date:', result.data);
} else {
  console.error('Error:', result.error);
}

Image Picker

// Pick image from gallery
const result = await RsLib.pickImage({
  mediaType: 'photo',
  quality: 0.8,
  maxWidth: 1024,
  maxHeight: 1024,
  allowsEditing: true
});

if (result.success) {
  console.log('Selected image:', result.data.uri);
} else {
  console.error('Error:', result.error);
}

// Pick video
const videoResult = await RsLib.pickVideo({
  videoQuality: 'high',
  durationLimit: 60
});

Document Picker

const result = await RsLib.pickDocument({
  type: ['public.item', 'public.pdf', 'public.text'],
  copyTo: 'cachesDirectory',
  readContent: true
});

if (result.success) {
  console.log('Selected document:', result.data);
} else {
  console.error('Error:', result.error);
}

Device Info

const result = await RsLib.getDeviceInfo();

if (result.success) {
  const deviceInfo = result.data;
  console.log('Device:', deviceInfo.brand, deviceInfo.model);
  console.log('OS:', deviceInfo.systemName, deviceInfo.systemVersion);
  console.log('Screen:', deviceInfo.screenWidth, 'x', deviceInfo.screenHeight);
  console.log('Memory:', deviceInfo.totalMemory, 'bytes');
} else {
  console.error('Error:', result.error);
}

Location Services

// Request location permission first
const permissionResult = await RsLib.requestLocationPermission();

if (permissionResult.success && permissionResult.data) {
  const locationResult = await RsLib.getCurrentLocation({
    enableHighAccuracy: true,
    timeout: 10000,
    maximumAge: 60000
  });

  if (locationResult.success) {
    const location = locationResult.data;
    console.log('Latitude:', location.latitude);
    console.log('Longitude:', location.longitude);
    console.log('Accuracy:', location.accuracy);
  }
}

Encryption/Decryption

// Encrypt text
const encryptResult = await RsLib.encrypt('Hello World', 'myPassword', {
  algorithm: 'AES',
  keySize: 256,
  mode: 'CBC'
});

if (encryptResult.success) {
  console.log('Encrypted:', encryptResult.data.encrypted);
  
  // Decrypt text
  const decryptResult = await RsLib.decrypt(
    encryptResult.data.encrypted, 
    'myPassword', 
    { iv: encryptResult.data.iv }
  );
  
  if (decryptResult.success) {
    console.log('Decrypted:', decryptResult.data);
  }
}

Base64 Conversion

// Convert image to base64
const result = await RsLib.imageToBase64('/path/to/image.jpg', {
  quality: 0.8,
  maxWidth: 1024,
  maxHeight: 1024
});

if (result.success) {
  console.log('Base64:', result.data.base64);
  console.log('MIME type:', result.data.mimeType);
  console.log('Size:', result.data.size);
}

// Convert file to base64
const fileResult = await RsLib.fileToBase64('/path/to/file.pdf');

Image Compression

const result = await RsLib.compressImage('/path/to/image.jpg', {
  quality: 0.7,
  maxWidth: 800,
  maxHeight: 600,
  format: 'JPEG'
});

if (result.success) {
  console.log('Compressed image:', result.data.uri);
  console.log('Original size:', result.data.originalSize);
  console.log('Compressed size:', result.data.size);
  console.log('Compression ratio:', result.data.compressionRatio);
}

Photo Merging

const result = await RsLib.mergePhotos('/path/to/photo1.jpg', '/path/to/photo2.jpg', {
  blendMode: 'normal',
  opacity: 0.5,
  position: { x: 0, y: 0 },
  scale: 1.0
});

if (result.success) {
  console.log('Merged photo:', result.data.uri);
  console.log('Dimensions:', result.data.width, 'x', result.data.height);
}

Permission Management

// Check permission
const hasPermission = await RsLib.checkPermission('camera');

// Request permission
const granted = await RsLib.requestPermission('location');

API Reference

Types

interface DatePickerOptions {
  mode?: 'date' | 'time' | 'datetime';
  minimumDate?: Date;
  maximumDate?: Date;
  title?: string;
  confirmText?: string;
  cancelText?: string;
  locale?: string;
}

interface ImagePickerOptions {
  mediaType?: 'photo' | 'video' | 'mixed';
  quality?: number;
  maxWidth?: number;
  maxHeight?: number;
  allowsEditing?: boolean;
  aspect?: [number, number];
  videoQuality?: 'low' | 'medium' | 'high';
  durationLimit?: number;
  cameraType?: 'front' | 'back';
}

interface DeviceInfo {
  brand: string;
  model: string;
  systemName: string;
  systemVersion: string;
  appVersion: string;
  buildNumber: string;
  bundleId: string;
  deviceId: string;
  isTablet: boolean;
  hasNotch: boolean;
  screenWidth: number;
  screenHeight: number;
  screenScale: number;
  fontScale: number;
  totalMemory: number;
  usedMemory: number;
  freeMemory: number;
  batteryLevel: number;
  isCharging: boolean;
  isLocationEnabled: boolean;
  isBluetoothEnabled: boolean;
  isWifiEnabled: boolean;
  carrierName?: string;
  timezone: string;
  locale: string;
  country: string;
}

// ... and many more types

Requirements

  • React Native >= 0.80.0
  • iOS >= 11.0
  • Android API Level >= 21

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

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

Support

If you encounter any issues or have questions, please file an issue on the GitHub repository.