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

@toolsmithhq/imagecore-files

v0.0.4

Published

High-level file-based API for imagecore — convert, resize, crop, rotate images by file URI

Downloads

149

Readme

@toolsmithhq/imagecore-files

High-level file-based image processing for React Native. File URI in, file URI out.

Part of ImageCore. Built on top of @toolsmithhq/imagecore-native.

Install

npm install @toolsmithhq/imagecore-native @toolsmithhq/imagecore-files

Quick Start

import { convertFile, resizeFile, getFileImageInfo } from '@toolsmithhq/imagecore-files';

const jpegUri = await convertFile('file:///path/to/photo.heic', 'jpeg', 0.85);
const thumbUri = await resizeFile(jpegUri, 200, 200, 'jpeg');
const info = await getFileImageInfo(jpegUri);

No ArrayBuffers, no manual memory management.

API

Convert format

import { convertFile } from '@toolsmithhq/imagecore-files';

const pngUri = await convertFile(sourceUri, 'png');           // default quality: 0.85
const jpegUri = await convertFile(sourceUri, 'jpeg', 0.9);  // custom quality

Resize

import { resizeFile } from '@toolsmithhq/imagecore-files';

const resizedUri = await resizeFile(sourceUri, 800, 600, 'jpeg');  // default quality: 0.95

Crop

import { cropFile } from '@toolsmithhq/imagecore-files';

// cropFile(uri, x, y, width, height, outputFormat, quality?)
const croppedUri = await cropFile(sourceUri, 100, 50, 400, 300, 'jpeg');  // default quality: 0.95

Rotate

import { rotateFile } from '@toolsmithhq/imagecore-files';

const rotatedUri = await rotateFile(sourceUri, 90, 'jpeg');  // 90, 180, or 270. default quality: 0.95

Flip

import { flipFile } from '@toolsmithhq/imagecore-files';

// flipFile(uri, horizontal, vertical, outputFormat, quality?). default quality: 0.95
const mirroredUri = await flipFile(sourceUri, true, false, 'png');  // horizontal flip
const flippedUri = await flipFile(sourceUri, false, true, 'png');   // vertical flip

Compress

import { compressFile } from '@toolsmithhq/imagecore-files';

const compressedUri = await compressFile(sourceUri, 0.5, 'jpeg');

Lossless JPEG rotate

Zero quality loss — rearranges DCT blocks directly without decoding pixels.

import { losslessJpegRotate } from '@toolsmithhq/imagecore-files';

const rotatedUri = await losslessJpegRotate(sourceUri, 90);

Image info

import { getFileImageInfo } from '@toolsmithhq/imagecore-files';

const info = await getFileImageInfo(sourceUri);
// { width: 4032, height: 3024, format: 'jpeg', hasExif: true, fileSize: 2048576 }

EXIF metadata

import { readFileExif, stripFileExif } from '@toolsmithhq/imagecore-files';

const exif = await readFileExif(sourceUri);
// { Make: 'Apple', Model: 'iPhone 15', DateTime: '2024:01:15 10:30:00', ... }

const strippedUri = await stripFileExif(sourceUri);

Utility functions

import { readFileAsArrayBuffer, writeArrayBufferToFile } from '@toolsmithhq/imagecore-files';

const buffer = await readFileAsArrayBuffer(sourceUri);
const outputUri = writeArrayBufferToFile(buffer, 'png');

Supported Formats

JPEG, PNG, WebP, BMP, TIFF, HEIC (iOS + Android), AVIF (macOS/WASM only)

License

MIT