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

dbmconfig

v0.1.6

Published

DB Managed Configuration Manager

Readme

DataBase Managed Configuration

Problema

Las aplicaciones necesitan variables permanentes y compartidas a lo largo de las instancias de la aplicación. Necesitan ser accesibles y modificables.

Limitantes

Si se usa con frecuencia o en alguna operación crítica en velocidad se debe considerar que por velocidad no se podría consutar cada vez o si se hace podría ser la base de datos un cuello de botella. Otra limitante es la base de datos que se elija. Por defecto es mongodb y la limitante que tiene esto es que cada documento (configuración) sólo puede tener 16MB de datos.

Hipótesis

Una librería con una sencilla api podría cubrir nuestras necesidades, porque:

  • Una función puede devolver un valor.
  • Podría pasarse la configuración de la base de datos, por lo que podría ser una solución multibase de datos, con una capa de compatibilidad.

Usage

init-dbm-config.js

const DBMConfig = require('dbmconfig')
const options = {
  mongo: {
    url: 'mongodb://localhost/config',
    collection: 'config',
    filter: {
      _id: 'my-config'
    }
  },
  default: {
    foo: 'bar',
    foobar: { foo: 'barfoo' }
  }
}
exports.config = DBMConfig(config)

where-i-need-to-use.js

const config = require('./init-dbm-config')
// ... inside a function or callback
  config.get('foo') // returns a Promise that resolves to 'bar', can be rejected on error.
  config.set('ayy', 'lmao') // returns a Promise that can be rejected on error.

  config.get('emptyVariable') // returns a Promise that will fail.
  config.get('emptyVariable', 'default') // returns a Promise that resolves to 'default'
//

API

DBMConfigInstance DBMConfig(options) Store the options in the given namespace and returns a instance. Overrides the namespace.

  • Object options

Promise(JSON | String | Number | Boolean) DBMConfigInstance.get(key, [default]) Get the value of the given key. Supports nested config like foo.bar for something like { foo: { bar: 'value' } }. returns a Promise that resolves the value. If default is not defined and the value is not available the Promise is rejected.

  • String key: The key of the stored value.
  • String default: If the value is not available, then resolves to the default.

Promise DBMConfigInstance.set(key, value) Set in a JSON Object the value in the given key. If a null is given at value, the key will be removed of the config. If there was a default, the default is not erased.

  • String key: The key of the stored value.
  • JSON | String | Number | Boolean | Null value: The value to be set. If null, erases it.

Run the tests

All you have to do is download the project and install all the dependencies launch a local instance of MongoDB and type npm test on your terminal.