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

@aquienpz/asset-compressor-native

v0.2.0

Published

Native (iOS/Android) image compression for the @aquienpz upload pipeline. JS API mirrors @aquienpz/asset-compressor-web so call sites are identical across web and React Native.

Downloads

264

Readme

@aquienpz/asset-compressor-native

Fast, native (iOS + Android) image compression for React Native apps that upload to the aquienpz asset platform. Pairs with @aquienpz/asset-uploader-expo and mirrors the API of @aquienpz/asset-compressor-web so call sites are identical across platforms.

Why this exists

expo-image-manipulator is the default option in Expo apps, but it runs the resize + re-encode through the JS bridge and ships an intermediate bitmap as a JS-heap allocation. On a 12MP iPhone HEIC, a single resize-to-2880px + JPEG q=0.85 takes ~2–4 seconds — long enough to make a 10-photo batch upload feel broken.

This package wraps react-native-compressor, which calls libjpeg-turbo (iOS) / Bitmap.compress (Android) on a background thread and never moves pixel data across the bridge. The same operation runs in ~250–350ms — roughly 5–10× faster than the Expo equivalent on identical hardware.

Install

# in your Expo / RN app
npm install @aquienpz/asset-compressor-native react-native-compressor
# Expo: also run the config-plugin once
npx expo prebuild

Add the plugin entry to app.json:

{
  "expo": {
    "plugins": ["react-native-compressor"]
  }
}

Usage

import { compressImage, compressImages } from "@aquienpz/asset-compressor-native";

// Single image
const result = await compressImage({
  uri: pickerAsset.uri,
  filename: pickerAsset.fileName ?? "photo.jpg",
});
// → { uri: 'file:///.../photo.jpg', size: 412903, originalSize: 4218876, compressionRatio: 0.097 }

// Batch
const { successful, failed } = await compressImages(
  pickerAssets.map((a, i) => ({ uri: a.uri, filename: a.fileName ?? `photo-${i}.jpg`, id: a.assetId })),
  { quality: 0.85, maxWidth: 2880, concurrency: 1 },
  (id, status, index) => console.log(`[${index}] ${id} → ${status}`),
);

Output format

Output is always JPEG. react-native-compressor natively supports only jpg / png, and the asset-manager re-encodes every uploaded image to WebP server-side anyway when generating size variants — so forcing WebP on device would cost binary size + native module maintenance for zero net bandwidth win.

The on-device savings (HEIC/big-JPEG → 2880px JPEG q=0.85) are already ~80–95% before the upload starts.

API parity with @aquienpz/asset-compressor-web

| Web | Native | | ---------------------------------------- | ----------------------------------------------- | | input Blob | input uri (file://, content://, ph://) | | output Blob (mime configurable) | output file uri on disk (always JPEG) | | compressionStatus: convertingHeic | not emitted (HEIC decode is part of compressing) | | concurrency: p-limit / navigator.hwc | concurrency: bounded worker pool, default 1 | | HEIC fallback: heic2any | HEIC handled natively by ImageIO / android-heif |

Everything else (quality default 0.85, maxWidth/Height 2880, status callback shape, error collection in compressImages) is identical.

Cleanup

react-native-compressor writes outputs to the app's cache directory. iOS will reclaim it under memory pressure; Android does the same when the cache exceeds cacheQuotaBytes. If you upload + don't need the local copy, delete it yourself with expo-file-system or react-native-fs once the upload completes.