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

sb_generator

v1.2.0

Published

NFT Generator with Supabase and AWS S3 storage options

Readme

NFT Generator Package

A flexible NFT generation package with support for Supabase and AWS S3 storage.

Installation

npm install sb_generator

Features

  • Generate NFTs with customizable layers
  • Support for both Supabase and AWS S3 storage
  • Pixelation effects
  • Transparency checking
  • Flexible configuration

Usage

Basic Usage

const { createGenerator, storage } = require('sb_generator');

async function generateNFTs() {
  // Create a storage provider
  const nftStorage = storage.createSupabaseStorage({
    url: 'YOUR_SUPABASE_URL',
    key: 'YOUR_SUPABASE_KEY',
    debug: true
  });
  
  // Initialize storage (creates buckets and folders)
  await nftStorage.initialize();
  
  // Create an NFT generator
  const generator = createGenerator({
    outputFolder: './output',
    species: ['indigo', 'green'],
    debug: true,
    storage: nftStorage
  });
  
  // Generate a single NFT
  const nft = await generator.generate(1, {
    species: 'indigo',
    includePixelated: true
  });
  
  console.log(`NFT generated: ${nft.nftUrl}`);
  
  // Generate multiple NFTs
  const nfts = await generator.generateMultiple(5, {
    species: 'random',
    includePixelated: true
  });
  
  console.log(`Generated ${nfts.length} NFTs`);
}

generateNFTs();

Using with AWS S3

const { createGenerator, storage } = require('sb_generator');

async function generateWithS3() {
  // Create an S3 storage provider
  const nftStorage = storage.createS3Storage({
    accessKeyId: 'YOUR_AWS_ACCESS_KEY',
    secretAccessKey: 'YOUR_AWS_SECRET_KEY',
    region: 'us-east-1',
    debug: true
  });
  
  // Initialize storage
  await nftStorage.initialize();
  
  // Create and use generator as before
  const generator = createGenerator({
    storage: nftStorage,
    // other options...
  });
  
  // Generate NFTs...
}

API Reference

Generator

createGenerator(options)

Creates a new NFT generator instance.

Options:

  • outputFolder: Where to save generated images
  • width: Image width (default: 512)
  • height: Image height (default: 512)
  • debug: Enable debug logging (default: false)
  • species: Available species (default: ['indigo', 'green'])
  • pixelateSize: Size for pixelation effect (default: 8)
  • storage: Storage provider instance
  • layers: Layer configuration (default: predefined layers)

generator.generate(id, options)

Generates a single NFT.

Parameters:

  • id: NFT ID/number
  • options.species: Species to generate ('indigo', 'green', or 'random')
  • options.includePixelated: Whether to generate pixelated version (default: true)

Returns an object with:

  • id: NFT ID
  • species: Generated species
  • nftPath: Local path to generated image
  • pixelatedPath: Local path to pixelated version
  • nftUrl: URL of uploaded image (if using storage)
  • pixelatedUrl: URL of uploaded pixelated version (if using storage)
  • metadata: NFT metadata

generator.generateMultiple(count, options)

Generates multiple NFTs with the given options.

Storage

Supabase Storage

const supabaseStorage = storage.createSupabaseStorage({
  url: 'YOUR_SUPABASE_URL',
  key: 'YOUR_SUPABASE_KEY',
  debug: true,
  componentsBucket: 'space-babiez', // Optional
  storageBucket: 'nft-storage'  // Optional
});

S3 Storage

const s3Storage = storage.createS3Storage({
  accessKeyId: 'YOUR_AWS_ACCESS_KEY',
  secretAccessKey: 'YOUR_AWS_SECRET_KEY',
  region: 'us-east-1',
  debug: true,
  componentsBucket: 'space-babiez', // Optional
  storageBucket: 'nft-storage'  // Optional
});

Utilities

Image Utilities

const { utils } = require('sb_generator');

// Pixelate an image
await utils.image.pixelate('input.png', 'output.png', 8);

// Check image transparency
const transparency = await utils.image.checkTransparency('image.png');
console.log(`Transparency: ${transparency.transparencyPercent}%`);

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

ISC