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 🙏

© 2024 – Pkg Stats / Ryan Hefner

supaapps-config-fetcher

v1.0.6

Published

![Supaapps Logo](https://supaapps.com/wp-content/uploads/logo.png)

Downloads

35

Readme

Supaapps Logo

Supaapps Config Fetcher

Managing configurations in applications can be cumbrersome, whether it's containerized deployments like Docker or traditional application distributions. Rebuilding an app or creating multiple versions for a single configuration change isn't efficient. supaapps-config-fetcher aims to simplify this.

supaapps-config-fetcher is an easy-to-use package developed by Supaapps GmbH to fetch configurations from a hosted JSON file based on the application's hostname. Although intended for internal use, we've made this package available under the MIT license. Feel free to integrate it into your projects.

Installation

npm install supaapps-config-fetcher

Or using Yarn:

yarn add supaapps-config-fetcher

Usage

Fetching Configurations: The primary purpose of this package is to fetch configurations<br from a hosted JSON file based on the application's hostname.

Below are an example config and how to use it with our package.

{
  "apiUrl": "http://localhost:8080/api"
}

TypeScript Support: Before using the package, define the expected return type for your<br configuration.

type MyAppConfig = {
    apiUrl: string;
};

To initialize and fetch the configuration, use the code provided below:

import { ConfigManager } from 'supaapps-config-fetcher';

const configManager = ConfigManager.getInstance<MyAppConfig>('example-app@v1');
const config = await configManager.loadConfig();
console.log(config.apiUrl);
// Outputs: "http://localhost:8080/api"

you should use custom host where your config.json files are hosted https://example.com and host your files with example-app@v1 then hostnames example: localhost.json

const customHostManager = ConfigManager.getInstance<MyAppConfig>('example-app@v1', 'https://example.com');

This will load the file from https://example.com/example-app@v1/localhost.json when the app is loaded from localhost

License

Notice: While this software is open-source under the MIT License, the "Supaapps" name, branding, and logo are proprietary and copyrighted by Supaapps GmbH. Any use, reproduction, or distribution of the "Supaapps" brand assets without explicit permission is strictly prohibited.

MIT License