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

@flk/config

v1.3.0

Published

Falak JS application runtime configurations.

Readme

Configurations

Most of the framework packages support developer default configurations to be used allover the called packages|components to be much easier on usage.

All of the configurations lies on file in the app directory config.js which should be located in src/appName/modules/config.js.

The Config class handles configurations in the runtime, thus it has nothing to do with the framework configurations in the config.json file in the root directory.

Table of contents

Usage

Now let's see how to use it.

Using the Config.extend method makes it more convenient to set bulk of configurations in one time.

config.js file

// runtime configurations
Config.extend({
    http: {
        endpoint: {
            baseUrl: '',
            apiKey: '', // used with the `key` for Authorization header 
        }
    }
});

Now let's see how to get any values from that config file.

Getting values from the config file

The Config class has Config.get method which makes it easy for you to get any value from it.

Get

get(key: string, defaultValue: any = null): any

This method is used to get any value from the config.js file using the object dot notation syntax.

The object dot notation syntax means that the configurations is marked as namespaces which means you can get the object value of a primary key in the configurations.

Let's see what does it mean in action.


let httpOptions = Config.get('http');
// the returned value will be: 
httpOptions = {
    endpoint: {
        baseUrl: '',
        apiKey: ''
    }

Now let's say that you want only the value of the apiKey, here we will use the object dot notation syntax

let endPointApiKey = Config.get('http.endpoint.apiKey');

That's it!, so if we want to get a certain value for a key from any of configurations you can write the key name like this mainKey.subKey.subSubKey.key.

Has

static has(key: string): boolean

To check if the given key exists in the configurations file.


if (Config.has('some.value')) {
    // do something
}

Set

static set(key: string, value: mixed): void

Set/Replace the value for the given key

Config.set('app.name', 'My New App Name!');

Precompiled configurations

There are some precompiled configurations that is added to the config handler, it all relies under the app scope.

For example: Config.get('app.name'); // Blog

List of precompiled configurations

Here is the available options under the app scope:

| key | Value | Description | |---|---|---| | name| Dynamic | Based on current application name, the value will be set.| | direction| ltr/rtl | The current direction of the application, defaults to the base direction of the app in the root config.json file.| | localeCode| Dynamic | The current locale code of the application, defaults to the base direction of the app in the root config.json file.| | env| development/production | Current environment mode of the application, on the flk serve it will be development.| | baseUrl| Dynamic | The base url set in the root config config.json file.| | scriptPath| Dynamic | The script path of the current application, defaults to / for base app.| | scriptUrl| Dynamic | The script full url of the current application, defaults to the baseUrl combined with scriptPath value.|