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

relyselfie

v2.0.0

Published

The `relySelfie.js` utility provides functions for analyzing images, detecting faces, and uploading images to a server.

Readme

relySelfie.js Usage Guide

The relySelfie.js utility provides functions for analyzing images, detecting faces, and uploading images to a server. This guide explains its key functionalities and how to use them.

Functions

1. loadFaceApiModels

Description: Loads the required face-api.js models for face detection and analysis.

Usage:

await loadFaceApiModels();

Models Loaded:

  • Tiny Face Detector
  • Face Landmark 68
  • Face Recognition
  • Age and Gender

2. analyzeImage

Description: Analyzes an image and returns feedback based on brightness, blur, face confidence, and other metrics.

Parameters:

  • imageData (ImageData): Raw image data from a canvas.
  • video (HTMLVideoElement): Video element for face detection.

Returns: An object containing:

  • status: "capture" or "analyzing".
  • score: Overall confidence score.
  • metrics: Brightness, blur, face confidence, coverage, age, and gender.
  • directives: List of actionable feedback.
  • timestamp: Timestamp of the analysis.

Usage:

const result = await analyzeImage(imageData, video);
console.log(result);

3. uploadImages

Description: Uploads images to a GraphQL endpoint.

Parameters:

  • imagesWithScores (Array): Array of image data URLs with scores.
  • customerId (string): Customer ID to associate with the images.

Environment Variable Required (in root app):

  • REACT_APP_NUM_IMAGES_TO_CAPTURE=3
  • REACT_APP_NUM_IMAGES_TO_UPLOAD=2
  • REACT_APP_UPLOAD_URL=http://localhost:5999/api/upload-images/

Usage:

await uploadImages(imagesWithScores, customerId);

Configuration

Ensure the following environment variables are set in the root of the app:

REACT_APP_NUM_IMAGES_TO_CAPTURE=3
REACT_APP_NUM_IMAGES_TO_UPLOAD=2
REACT_APP_UPLOAD_URL=http://localhost:5999/api/upload-images/ # Proxy endpoint for image uploads

Proxy for Image Uploads

The uploadImages function sends images to a proxy server defined by the REACT_APP_UPLOAD_URL environment variable. This proxy server forwards the images to the GraphQL endpoint, ensuring secure and efficient uploads. While also allowing rate-limiting.


Example Workflow

  1. Load the face-api.js models:

    await loadFaceApiModels();
  2. Capture an image from a video feed and analyze it:

    const result = await analyzeImage(imageData, video);
    console.log(result);
  3. Upload the captured images:

    await uploadImages(imagesWithScores, customerId);

Notes

  • Ensure the .env file is properly configured with the required thresholds and API key.
  • The utility relies on face-api.js for face detection and analysis. Make sure the models are available in the public/models directory.

For more details, refer to the source code in src/relyselfie/relySelfie.js.

License

This project is licensed under the MIT License.