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

@yokejs/core-config

v0.0.7

Published

![CI](https://github.com/yokejs/core-config/workflows/Build/badge.svg) ![CI](https://github.com/yokejs/core-config/workflows/Tests/badge.svg) ![CI](https://github.com/yokejs/core-config/workflows/Linting/badge.svg)

Readme

CI CI CI

Yoke.js Config

Yoke.js Config is a simple Node.js filesystem config manager.

It supports an optional Yoke.js Cache driver for improved performance.

It uses dot notation for fetching deeply nested values.

Installation

$ yarn add "@yokejs/core-config" or $ npm install "@yokejs/core-config"

Usage

Setting up your config files

A config file is simply an exported JavaScript object like the following:

// config/app.js
module.exports = {
    name: "My application",
    env: "local",
}

Files are placed in a base config directory and you can have as many nested folders and files as you like.

Here's an example Yoke.js Config file structure:

--config
----cache
------redis.js
----app.js
----database.js

You can view a full example here with config keys and values.

Initialising the config with the filesystem cache (recommended)

import Cache, {FileSystemCache} from '@yokejs/core-cache'
import Config from '@yokejs/core-config'

const configDirectory = path.resolve(__dirname, './config')
const cacheDirectory = path.resolve(__dirname, './cache')

const cache = Cache(
  FileSystemCache({
    directory: cacheDirectory,
  }),
)

const config = Config({ configDirectory, cache })

Initialising the config without caching

import Config from '@yokejs/core-config'

const configDirectory = path.resolve(__dirname, './config')

const config = Config({ configDirectory })

Fetching the entire config

// Initialise the config as instructed above

...

const entireConfig = await config.get()

console.log(JSON.stringify(entireConfig))

Outputs:

{
    cache: {
      redis: {
        cluster: true,
        default: {
          host: '127.0.0.1',
          port: 6379,
        },
      },
    },
    app: {
      name: 'My application',
      env: 'local',
    },
    database: {
      connections: {
        default: {
          driver: 'pg',
          database: 'my-database',
          username: 'my-username',
          password: 'my-password',
          port: 5229,
        },
      },
    },
}

Fetching a single config value

// Initialise the config as instructed above

...
const appName = await config.get('app.name')

console.log(appName)
// Outputs: My application

Fetching a single config value and falling back to a default value

// Initialise the config as instructed above

...
const appName = await config.get('a.key.that.does.not.exist', 'My application')

console.log(appName)
// Outputs: My application

Invalidating the config cache

// Initialise the config as instructed above

...

await config.flush()

License

Yoke.js Config is open-sourced software licensed under the MIT License.