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

@megadoomer/membrane

v1.0.2

Published

Low level cache implementation for megadoomer platform

Downloads

4

Readme

Membrane

The multi caching package

Configuration

Configuration consists of an object found at the caches key. Each key in the object will be considered a unique cache. Each Cache will be available as a property on the membrane module or as a callable from the package itself. Their must be one and only one cache named default which will be the primary cache when no cache is specified.

the following configuration would set up two caches, the default, a redis cache, and a testing cache, an in memory cache

config
{
  "caches":{
    "default":{
      "backend":"redis"
    }
    ,"testing":{
      "backend":"memory",
    }
  }
}
usage
var cache = require( 'membrane' );

// using the redis cache
cache.set('foo', 'bar')

// using the dummy cache explicitly
cache.dummy.set('foo', 'bar')

// using the dumy cache though the cache callable
cache( 'dummy' )
  .set('foo','bar' )

Caches

options | default | type | description --------|---------|------|------------ backend | dummy | string | one of the predefined backends, redis, memcached, memory, dummy, or a fully qualified path to a module which exports a class which implements the cache interface location | "" | string / object | a connection string or object containing host, port, and auth creds if required timeout | 30000 | number | the time to live in ms. prefix | "membrane" | string | a keyspace name-space to separate specific sets of keys options | null | object | driver specific options to be passed to the connection

{
  "caches":{
    "default":{
      "backend":"memcache",
      "location":{
        "host":"0.0.0.0",
        "port":11211
      }
    }
    ,"counters":{
      "backend":"redis"
      ,"location":"unix://user:abc123@localhost:6379"
      ,options:{
        "return_buffers":false,
        "no_ready_check":true
      }
    }
  }
}

Backends

Dummy

A noop backend to use for testing when a server is not available

Redis

Backend using the redis database driver. Reids support atomic operations for lists, hashes, sets, counters, and transactions

Memcached

Backend using memcached, the low volatile key/value in memory hash table.