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

@vyui/camera

v0.0.2

Published

A Lynx-native camera surface with plain TypeScript APIs and native iOS/Android hooks.

Downloads

27

Readme

[!WARNING] Pre-alpha. The package publishes as 0.0.x while the surface settles. iOS photo capture is proven on a physical iPhone, Android is written but has never been compiled or run, and the recording and session controls are written but unverified on both platforms. Any release can break you, so read the platform support table before depending on this. The first real launch will be 1.0.0.

Chimera Camera is a native camera library for Lynx, built off the amazing work in react-native-vision-camera. Its architecture, its native camera handling, and a good deal of its implementation come from that project, rebuilt against Lynx's native APIs. It targets Lynx directly instead of wrapping React Native, which is why the public API is plain TypeScript that any JS framework can drive.

  • 📸 Photo capture, through an embedded preview or the system camera
  • 🎥 Video recording with optional audio (written, unverified)
  • 🔦 Zoom, torch, and tap-to-focus (written, unverified)
  • 🔄 Front/back switching, resizeMode, and live active toggling
  • 🖼️ Photo-library picking
  • 🔐 Camera and microphone permission checks and requests
  • ⚛️ Framework-neutral, so React, Vue, Svelte, or plain TypeScript all work unwrapped
  • 🧪 A mock adapter, so app flows can be built before any native wiring exists
  • 🩺 Install diagnostics that name the native step you are missing
  • 📁 File paths across the bridge rather than multi-megabyte base64 payloads

Installation

pnpm add @vyui/camera

That is everything JavaScript needs. The types, the mock adapter, and the install diagnostics work immediately, so you can build a complete capture flow before touching a native host:

import { createCameraModule } from '@vyui/camera'

const camera = createCameraModule({ mock: true })

A real camera also needs your Lynx host app to compile the shipped native sources and register them, which is two build-config lines and one registration call per platform. INSTALLATION.md walks through all of it, including the iOS podspec, the Android Gradle module, and troubleshooting.

Note that LynxExplorer and Lynx Go can only run the mock. Neither compiles native source from an installed npm package at runtime, so the native path needs a host app you build yourself.

Example

You render the element and then drive it through a handle. No framework wrapper sits in between, because this is plain TypeScript talking to the Lynx element:

<camera-view id="camera" active={true} facing="back" bindready={onReady} />
import { createCameraViewHandle } from '@vyui/camera'

const camera = createCameraViewHandle('#camera')

const photo = await camera.capturePhoto({ flash: 'auto' })
console.log(photo.path) // display with `file://${photo.path}`

await camera.setZoom(2)
await camera.startRecording({ enableAudio: true })
const video = await camera.stopRecording()

Two runnable demos drive that same core from different frameworks: example/react and example/vue.

Platform support

| Platform | Status | Verified | | -------- | ------ | -------- | | iOS | Alpha | Device-proven on a physical iPhone: preview, photo capture, front/back switch, close/reopen. Recording and session controls are written but unverified. | | Android | Experimental | Written to the same contract as device-proven iOS and believed to work, but never compiled or run on any device or emulator. See docs/android-testing.md. | | Mock | Stable | Framework-neutral JS double for all hosts. |

Android ships as experimental on purpose. The Kotlin/CameraX surface mirrors docs/native-contract.md and the device-proven iOS behavior, which is fair reason to expect it to work, but nobody has confirmed that on hardware yet. Treat Android as unsupported until it passes device acceptance.

How it fits together

TypeScript is the developer-facing API, Swift and AVFoundation power iOS, Kotlin and CameraX power Android, and Lynx's native view and module APIs bridge between them. React Native, Nitro Modules, and JSI are not dependencies.

The library exposes two surfaces, and every operation belongs to exactly one of them:

  • Module (createCameraModule()CameraModuleClient) handles stateless, one-shot operations that need no rendered view: permissions, device discovery, system-camera capture, and photo-library picking.
  • Session (createCameraViewHandle()CameraViewHandle) handles controls tied to a live <camera-view>: view capture, recording, focus, zoom, torch, and ping().

Captures return a native file path rather than base64. You display one with file://${photo.path}, upload by streaming the file at that path, and own the temp file from that point on, to persist or delete as you see fit. base64 stays available as an opt-in fallback bounded by maxDimension, which is what you want for mock previews, web previews, and JSON transports.

Links

Credits and licensing

Chimera Camera is built off react-native-vision-camera by Marc Rousavy and its contributors, and the debt runs deeper than inspiration. This project lifts source, structure, and implementation approach from it wherever the MIT license allows, then rebuilds that work against Lynx rather than React Native. VisionCamera is copyright 2021 Marc Rousavy and MIT licensed, and those terms carry over to everything ported here. It is worth saying plainly that this would be a much smaller project without it.

The camera glyph in the logo, the banner, and the example app icons comes from Material Symbols, copyright Google LLC, licensed under the Apache License 2.0. The original glyph was recolored from a solid fill to a violet-to-teal gradient and rasterized to PNG and WebP.

Chimera Camera's own code is MIT licensed, and LICENSE has the text. The package declares MIT AND Apache-2.0 because the shipped artwork derives from Apache-licensed material. THIRD_PARTY_NOTICES.md reproduces VisionCamera's MIT license in full alongside the Material Symbols notice, and the Apache text sits in LICENSES/Apache-2.0.txt.

This is not the official VisionCamera package and has no affiliation with it.