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 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-fast-camera

v0.1.0

Published

High-quality and fast camera component for react native

Downloads

7

Readme

Motivation

I was looking for a flexible and fast camera component for react native, tried react-native-camera and react-native-camera-kit but was not satisfied with the performance. In a nutshell, this module is the product of months of research and experimentations with an aim to create a useful solution.

Getting Started

1. Installation

  • with yarn: yarn add react-native-fast-camera
  • with npm: npm install --save react-native-fast-camera

2. Linking

    1. Copy ios/FastCamera folder to your ios folder.
    1. from Xcode Project navigator select Add Files to "project name" then select ios/FastCamera.

3. Permissions

Add the following permission strings to your info.plist file, update the messages according to your needs. Otherwise your app will crash.

<key>NSCameraUsageDescription</key>
<string>We need to access your camera to take pictures.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>We need to access your photo library to save the captured pictures.</string>

Usage

  import FastCamera, { Methods } from 'react-native-fast-camera';
  <FastCamera style={{ height: cameraHeight, width: cameraWidth }}
    onSaveSuccess={imageUrl => {
      console.log("onSaveSuccess: ", imageUrl);
    }}
    onGalleryImage={imageUrl => {
      console.log("onGalleryImage: ", imageUrl);
    }}
    onFlashToggle={isflashOn => {
      console.log('flash info: ', isflashOn);
    }}
  >
    {/* here render your buttons to control the camera component */}
  </FastCamera>

API

| Property | Type | Description | |----------|:-------------:|----------| | onSaveSuccess | Callback | a callback triggered when the image was captured and saved successfully | | onGalleryImage | Callback | a callback triggered when the image was selected from the user photo library | | onFlashToggle | Callback | a callback triggered when the flash status change | | timer | Method | Methods.timer() a method to show timer UI | | toggleFlash | Method | Methods.toggleFlash() a method to toggle flash mode | | takePicture | Method | Methods.takePicture() a method to capture a picture | | pickImage | Method | Methods.pickImage() a method to pick an image from the photo library | | flipCamera | Method | Methods.flipCamera() a method to flip the camera face (front/back) |

TODO

  • [x] Take a picture.
  • [x] Pick an image from photo library.
  • [x] Flip camera.
  • [x] Flash On/Off mode.
  • [x] Add timer.
  • [ ] Add Android support.
  • [ ] Add prop to set camera default face (front/back).
  • [ ] Export the iOS component as a pod module.

ACKNOWLEDGEMENTS