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

@mutable/meta

v1.5.0

Published

Meta client for node

Downloads

10

Readme

Mutable Meta client for node

Service Discovery and Config manager

This package is a wrapper to the background service Mutable Meta. Mutable Meta is responsible for service discovery and service configuration.

API

const Meta = require('@mutable/meta')

All methods are asynchronous, and take a node-style error-first callback as last argument. If no callback is supplied, a promise is returned instead.

Service Discovery

Meta.services() -> Array

Returns all the currently known service names.

Example:


  Meta.services()
    .then((_services) => {
      // returns an object {}
    })

Meta.service(service: String) -> Service

Returns a particular service.

Example:


  Meta.service("email")
    .then((service) => {
      request.post(`http://${service}/api/v1/demo/email`,
        {json:req.body},
        (error, response, body) => {
          if(error){
            console.error('can not reach email service')
            return res.send(500,{error:error,result:'can not reach email service'})
          }
          res.send({result:"email sent"})
        })
    })

or


  Meta.service("email", (config) => {

    // returns a object
    // {"hostname":"127.0.0.1", "port":3001, toString(): "127.0.0.1:3001" }
    // in a string it prints concat host and port

    request.post(`http://${service}/api/v1/demo/email`,
    {json:req.body},
    (error, response, body) => {
      if(error){
        console.error('can not reach email service')
        return res.send(500,{error:error,result:'can not reach email service'})
      }

      res.send({result:"email sent"})
    })
  })

Config

Meta.config() -> JSON

Fetches the JSON configuration for the current service.

Example:


  Meta.config()
    .then((_config) => {
      // returns an object {}
    })

For non-mutable deployments set USE_SECRETS=true environment variable to set secrets in the config. Use CONFIG environment variable to store configs when using secrets. Use SECRET_ prefix to set secrets as object in the config.

Example:

	USE_SECRETS=true CONFIG={"key":"value"} SECRET_SENDGRID_KEY='your_key' SECRET_REDIS='{"db":00}' node app.js

Resulting in this config object:

{
	"key": "value",
	sendgrid_key: "your_key",
	redis: {
		"db": 00
	}
}

SECRET_ prefix gets removed when setting the key in the config object.

DNS

For non-mutable deployments set DNS environment variable to true and use DNS_POSTFIX variable to modify the service url

Example:

DNS=true DNS_POSTFIX='.default.csv.cluster.local' node app.js

Result target: http://your-web-service.default.scv.cluster.local/

Resources