node package manager


A future wrapper around the Node Memcached driver using Poseidon.

Poseidon Memcached

Poseidon Memcached provides a promise layer around the node memcached module with the help of the Poseidon library.

To get started simply run

npm install poseidon-memcached

A basic example of performing serveral operations on a cache which would normally result in callback hell is shown below.

{DriverCache} = require '../index'
Driver.configure('default'{ servers: 'localhost:11212' })
cache = new Cache('default')
cache.add('test'{ foo: 'bar' }0)
.then ->
  console.log 'object added'
.then (obj) ->
  console.log 'object retrieved'obj
.then ->
  console.log 'object deleted'
  cache.add('test'{foo: 'bar returns' }0)
.then ->
  cache.add('test2'{bar: 'foo'}0)
.then ->
  console.log 'new objects added'
.then (objs) ->
  console.log 'objects retrieved'objs
.fail (err) ->
  console.error err
.finally ->
  console.log 'connection closed'

All functions of the original module are available

  • get
  • gets
  • getMulti
  • add
  • set
  • del
  • cas
  • flush

The MIT License

Copyright(c) 2013-2014, Playlyfe Technologies,,