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

memcaching

v0.4.3

Published

Library to speak the memcache text protocol

Downloads

4

Readme

Memcaching Build Status

The central goal of Memcaching is simplicity: to create a Memcache client that is made up of components that do precisely one thing, and combine those components in an easy-to-understand way.

For example, many memcache clients combine network connections, command queueing, protocol details and command semantics more or less all in one module. Here, each task is tackled by a different component:

  • MemcacheClient provides an easy-to-use interface for connecting to a Memcache server (or pool of servers) and issuing commands against it.
    • ConnectionPool serves up connections to a set of servers to be used with consistent hashing, and distributes commands to the correct one based on the hashes of the keys in the command
    • MemcacheSocket represents a connection to a memcached server, and uses a CommandQueue to manage requests to the MemcacheStream on the underlying socket.
      • CommandQueue is responsible for managing a queue of commands to be executed against a resource. Commands are just functions that take two arguments - the resource they want to operate on, and a callback to fire when they are done with it.
      • TextCommandCompiler is used by MemcacheSocket to compile commands from parameters to commands appropriate for use with a CommandQueue serving up a MemcacheStream
        • The commands directory contains implementations for different commands used by Memcache. Each command takes a set of parameters and returns a function that serves as a Command for the CommandQueue, taking a MemcacheStream as the first parameter and a done callback as the second.
      • MemcacheStream is a wrapper than uses DelimitedStream to provide an incredibly simple interface to speak the Memcache text protocol. It handles surfacing errors from the server, reading binary buffers, and parsing responses made of parameter tuples. Uses:
        • DelimitedStream is a wrapper on top of a Node 0.10 Duplex Stream that can send and recv messages delimited by a particular terminator. recv request are guaranteed to be processed in-order. DelimitedStream also uses CommandQueue.

The hope is that by separating out the components it will be easier to understand, test, hack and extend.