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

trooba-memcached-transport

v0.1.0

Published

memcached transport for trooba pipeline

Readme

trooba-memcached-transport

codecov Build Status NPM Downloads Known Vulnerabilities

A Memcached transport for trooba pipeline. All APIs of Memcached are supported in this transport.

Installation

npm install trooba-memcached-transport --save

Usage

var memcachedTransport = require('trooba-memcached-transport');    

const client = require('trooba')
                .use(memcachedTransport, {
                clientId: 'dev-memcached',
                servers: [ 
                    'memcached1.dev.myorg.com:11211',
                    'memcached2.dev.myorg.com:11211'],
                })
                .build()
                .create('client');

await client.set('test-key','test value', 0});
const retrievedValue = await client.get('test-key' );
console.log(retrievedValue);

Get Involved

  • Contributing: Pull requests are welcome!
  • Support: Join our gitter chat to ask questions to get support from the maintainers and other Trooba developers

Setting up memcached client

You can setup memcached client by configuring three properties clientId, servers and options.

  • clientid - an unique identifier associated with memcached client.
  • servers - location of memcached servers. Please refer to the documentation here on various ways to configure server locations.
  • options - various options to configure the connection. Please refere to the documentation here for various options to configure.
const configs = {
                clientId: '<an unique id>',
                servers: '<location of memcached servers>',
                options: '<options to configure the client>'               
                };

const client = require('trooba')
                .use(memcachedTransport, configs)
                .build()
                .create('client');

API

client.touch Touches the given key.

  • key: String The key
  • lifetime: Number After how long should the key expire measured in seconds
await client.touch('key', 10);

client.get Get the value for the given key.

  • key: String, the key
const data = await client.get('foo')
console.log(data);

client.gets Get the value and the CAS id.

  • key: String, the key
const data = await client.gets('foo');
console.log(data.foo);
console.log(data.cas);

client.getMulti Retrieves a bunch of values from multiple keys.

  • keys: Array, all the keys that needs to be fetched
const data = await client.getMulti(['foo', 'bar']);
console.log(data.foo);
console.log(data.bar);

client.set Stores a new value in client.

  • key: String the name of the key
  • value: Mixed Either a buffer, JSON, number or string that you want to store.
  • lifetime: Number, how long the data needs to be stored measured in seconds
client.set('foo', 'bar', 10);

client.replace Replaces the value in client.

  • key: String the name of the key
  • value: Mixed Either a buffer, JSON, number or string that you want to store.
  • lifetime: Number, how long the data needs to be replaced measured in seconds
await client.replace('foo', 'bar', 10);

client.add Add the value, only if it's not in client already.

  • key: String the name of the key
  • value: Mixed Either a buffer, JSON, number or string that you want to store.
  • lifetime: Number, how long the data needs to be replaced measured in seconds
await client.add('foo', 'bar', 10);

client.cas Add the value, only if it matches the given CAS value.

  • key: String the name of the key
  • value: Mixed Either a buffer, JSON, number or string that you want to store.
  • lifetime: Number, how long the data needs to be replaced measured in seconds
  • cas: String the CAS value
const data = await client.gets('foo');
await client.cas('foo', 'bar', data.cas, 10);

client.append Add the given value string to the value of an existing item.

  • key: String the name of the key
  • value: Mixed Either a buffer, JSON, number or string that you want to store.
await client.append('foo', 'bar');

client.prepend Add the given value string to the value of an existing item.

  • key: String the name of the key
  • value: Mixed Either a buffer, JSON, number or string that you want to store.
await client.prepend('foo', 'bar');

client.incr Increment a given key.

  • key: String the name of the key
  • amount: Number The increment
await client.incr('foo', 10);

client.decr Decrement a given key.

  • key: String the name of the key
  • amount: Number The increment
await client.decr('foo', 10);

client.del Remove the key from client.

  • key: String the name of the key
await client.del('foo');

client.version Retrieves the version number of your server.

client.flush Flushes the client server.

client.stats Retrieves stats from your client server.

client.settings Retrieves your stats settings.

client.slabs Retrieves stats slabs information.

client.items Retrieves stats items information.

client.end Closes all active client connections.