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

cloud-solutions

v4.5.0

Published

This project is meant to ease the pain of migrating from one solution to another and also to ease local tests by providing equivalent local solutions.

Readme

Cloud solutions factory

This project is meant to ease the pain of migrating from one solution to another and also to ease local tests by providing equivalent local solutions.

Changelog

  • Version 4
    • Solutions mapped

      • Events
      • Storage
      • Secrets
      • Authentication
    • Factories available

      • Events: AWS: SQS, ThirdParty: RabbitMQ
      • Storage: AWS: S3, GCP: Storage, ThirdParty: SFTP, Local: FS
      • Secrets: AWS: ParameterStore, GCP: SecretManager, Local: Env
      • Authentication: AWS: Cognito (soon), ThirdParty: Keycloak

Usage

The core feature here is to use the abstract factory to provide the solutions you want to use by setting configurations accordingly. You can use only one solution, like storage, or all of them each one from a different provider. Every combination works just fine.

Recommendation

I personally use dotenv library with .env file to map config variables and on some cases secrets into cloud

Configuration

1. How to use a single solution

This is the way you should implement so you can change storage provider just by changing environment variables when needed.

import { SolutionsFactory, StorageInterface } from 'cloud-solutions-factory';

export const getStorage = async (): Promise<StorageInterface> => {
    // instantiate the factory
    const solutions = new SolutionsFactory();
    // describe what solutions you need
    const { storage } = await solutions.initialize({
        storage: process.env.STORAGE_PROVIDER,
        // provider options are optional if you specify everything on each solution
        // when you are using only one solution is simpler to set them after into solution "initialize" method
        providerOptions: {}
    });

    // configure what functionalities you need
    const { storage } = await solutions.initialize({
        storage: process.env.STORAGE_PROVIDER,
    });

    // s3 storage must receive the name of the bucket
    await storage.initialize({
        // provider options
        region: process.env.CLOUD_REGION,
        user: process.env.CLOUD_USER,
        pass: process.env.CLOUD_PASS,
        // bucket name
        Bucket: process.env.STORAGE_BUCKET,
    });

    return storage;
};

2. How to use multiple solutions

Sample explained by a simple linear code:

import { SolutionsFactory, EventsInterface, SolutionsInterface } from 'cloud-solutions-factory';
import { queuehandler } from './queues/handler';

// your variable that will hold factory instance
let _solutions;

export const configFactory = async () => {
    // make sure to configure only once
    if (_solutions) return;

    _solutions = new SolutionsFactory();

    // configure what functionalities you need
    const { storage, secrets, events } = await _solutions.initialize({
        // provider defines all default solutions from same cloud, but after you can specify if any are different
        provider: process.env.CLOUD_PROVIDER,
        // the solutions specified below will replace the provider default. they are optional if you use everything from a unique cloud provider
        // events management
        events: process.env.QUEUE_PROVIDER,
        // secrets management
        secrets: process.env.SECRETS_PROVIDER,
        // file storage
        storage: process.env.STORAGE_PROVIDER,
        // provider options like region and access keys
        providerOptions: {
            user: process.env.CLOUD_USER,
            pass: process.env.CLOUD_PASS,
            region: process.env.CLOUD_REGION, // aws/gcp only
            project: process.env.CLOUD_PROJECT, // gcp only
        }
    });

    // initialize libs is needed to set their options

    // s3 storage can receive a default bucket
    // but you can also specify the bucket when reading or sending a directory or file
    await storage.initialize({
        Bucket: process.env.STORAGE_BUCKET,
    });

    await secrets.initialize();

    // rabbitmq needs connection parameters
    await events.initialize({
        host: process.env.QUEUE_HOST,
        port: process.env.QUEUE_PORT,
        user: process.env.QUEUE_USER,
        pass: process.env.QUEUE_PASSWORD,
        // a function must be send to load your queues under the connection estabilished
        loadQueues,
    });
};

// this function is going to instantiate the factory and set it's options
export const loadSolutions = async (): Promise<void> => {
    await configFactory();
};

// and return the solutions
export const getSolutions = (): SolutionsInterface => {
    return _solutions.getAll();
};

// this function is going to load queues every time a connection is estabilished
const loadQueues = async (events: EventsInterface) => {
    events.loadQueue(queuehandler.name, queuehandler.handler);
};