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

@holofy/utils

v1.0.12

Published

Utility functions for Holofy

Readme

holofy-utils

About

Utility functions

  • @holofy/utils provides the following utility functions:

  • { s3: { uploadBase64: uploadBase64(content, folder, bucket), uploadMedia: uploadMedia(req, folder, bucket), uploadImage: uploadImage(path, folder, bucket), } }

Usage

Install the package:

npm install @holofy/utils --save-prod

Import as necessary:

const Utils = require('@holofy/utils');
const utils = Utils(config.utils);

To test on dev

Add .env to project root folder

AWS_S3_ACCESS_KEY=
AWS_S3_SECRET=
AWS_S3_REGION=
AWS_S3_BUCKET=

uploadBase64

Add /sandbox/upload-base64-index.js to project root folder

// eslint-disable-next-line import/no-extraneous-dependencies
require('dotenv').config();
const fs = require('fs');

const Utils = require('../index');

const config = {
  s3: {
    awsS3AccessKey: process.env.AWS_S3_ACCESS_KEY,
    awsS3Secret: process.env.AWS_S3_SECRET,
    awsS3Region: process.env.AWS_S3_REGION,
    awsS3Bucket: process.env.AWS_S3_BUCKET,
  },
};

const utils = Utils(config);

const content = fs.readFileSync('./sandbox/image.txt', 'utf8');

Promise.resolve()
  .then(() => utils.s3.uploadBase64(content, 'spaces', config.s3.awsS3Bucket))
  .then((key) => console.log(`Upload ${key} to ${config.s3.awsS3Bucket} completed`));

Add /sandbox/image.txt to project root folder

image.txt should contain a base64 encoded image string data

On terminal

npm i && node sandbox/upload-base64-index.js

uploadMedia TODO: update

Add /sandbox/upload-media-index.js to project root folder

// eslint-disable-next-line import/no-extraneous-dependencies
require('dotenv').config();
const http = require('http');
const Utils = require('../index');

const PORT = process.env.PORT || 8080;

const config = {
  s3: {
    awsS3AccessKey: process.env.AWS_S3_ACCESS_KEY,
    awsS3Secret: process.env.AWS_S3_SECRET,
    awsS3Region: process.env.AWS_S3_REGION,
    awsS3Bucket: process.env.AWS_S3_BUCKET,
  },
};

const server = http.createServer((req, res) => {
  if (req.url === '/') {
    res.writeHead(200, { 'content-type': 'text/html' });
    res.end(
      '<form action="/upload" enctype="multipart/form-data" method="post">'
        + '<input type="text" name="title"><br>'
        + '<input type="file" name="file" multiple="multiple"><br>'
        + '<input type="submit" value="Upload">'
        + '</form>',
    );
  } else if (req.url === '/upload') {
    const utils = Utils(config);

    Promise.resolve()
      .then(() => utils.s3.uploadMedia(req, 'assets/video', config.s3.awsS3Bucket))
      .then((result) => res.end(`Upload ${JSON.stringify(result)} to ${config.s3.awsS3Bucket} completed`));
  } else {
    res.writeHead(404, { 'content-type': 'text/plain' });
    res.end('404');
  }
});
server.listen(PORT, () => {
  console.info(`listening on http://localhost:${PORT}/`);
});

On terminal

npm i && node sandbox/upload-media-index.js

uploadImage

Add /sandbox/upload-image-index.js to project root folder

// eslint-disable-next-line import/no-extraneous-dependencies
require('dotenv').config();

const Utils = require('../index');

const config = {
  s3: {
    awsS3AccessKey: process.env.AWS_S3_ACCESS_KEY,
    awsS3Secret: process.env.AWS_S3_SECRET,
    awsS3Region: process.env.AWS_S3_REGION,
    awsS3Bucket: process.env.AWS_S3_BUCKET,
  },
};

const utils = Utils(config);

Promise.resolve()
  .then(() => utils.s3.uploadImage('./screenshot-1.jpg', 'assets/video/images', config.s3.awsS3Bucket))
  .then((key) => console.log(`Upload ${key} to ${config.s3.awsS3Bucket} completed`));

On terminal

npm i && node sandbox/upload-image-index.js

uploadFile

Add /sandbox/upload-file-index.js to project root folder

// eslint-disable-next-line import/no-extraneous-dependencies
require('dotenv').config();

const Utils = require('../index');

const config = {
  s3: {
    awsS3AccessKey: process.env.AWS_S3_ACCESS_KEY,
    awsS3Secret: process.env.AWS_S3_SECRET,
    awsS3Region: process.env.AWS_S3_REGION,
    awsS3Bucket: process.env.AWS_S3_BUCKET,
  },
};

const utils = Utils(config);

Promise.resolve()
  .then(() => utils.s3.uploadFile('./sandbox/index.html', 'accountWidget', config.s3.awsS3Bucket))
  .then((key) => console.log(`Upload ${key} to ${config.s3.awsS3Bucket} completed`));

On terminal

npm i && node sandbox/upload-file-index.js

Please do not commit sandbox/* and .env

Publish New Package

  • Only once: In this repository: Add NPM_AUTH_TOKEN to GitLab -> Settings -> CI/CD -> Settings -> Variables
git add .
git commit
npm version [major | minor | patch]