Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

memcachejs

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

memcachejs

simple memcache client implementation with pooling and string buffer usage

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
increased by250%
Maintainers
1
Weekly downloads
 
Created
Source

h1. Memcache.js

This is an implementation of the memcache protocol written in javascript. It uses the sockets layer as provided by the node.js "net" module.

To use the code, you can include it as an external include directly from your project:

bc. Memcache = require('/path/to/memcache');

Or, alternatively, you can checkout / copy the code from this repository into the node_modules subfolder of your project by hand, and include it like this:

bc. Memcache = require('memcache')

An npm installation that will simplify inclusion is currently being worked on.

Simple usage example:

bc.. // Host and port of the constructor are optional. Default values are "localhost" and 11211. var connection = new Memcache(host, port);

// setting key "some_key" to the value "some_value" on the memcache server connection.set('some_key', 'some_value'); // same with callback and additional options connection.set('some_key', 'some_value', { expires:60, flags:0, callback: function () { // do something here } });

// retrieve key "some_key" from the memcache server connection.get('some_key', function(response) { if (response.success) { // process results, they are stored in response.data console.dir(response.data); } }); bc.

After you are finished getting / setting data from your server, you should tell all connections to close by issuing the @shutdown()@ command:

bc. connection.shutdown();

This client uses connection pooling, as suggested by the memcached documentation. If you'd like to turn it off, set Memcache.pooling to false.

Keywords

FAQs

Package last updated on 16 May 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc