{"id":21930109,"url":"https://github.com/aheissenberger/meteor-memjs","last_synced_at":"2026-05-09T13:02:48.035Z","repository":{"id":149062561,"uuid":"44417150","full_name":"aheissenberger/meteor-memjs","owner":"aheissenberger","description":"A Meteor wrapper for memjs memcache client with binary protocol and SASL authentication for MemCachier","archived":false,"fork":false,"pushed_at":"2015-10-17T22:14:25.000Z","size":140,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-19T21:48:48.698Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aheissenberger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-17T00:15:57.000Z","updated_at":"2015-10-18T20:19:53.000Z","dependencies_parsed_at":"2023-04-10T11:22:52.503Z","dependency_job_id":null,"html_url":"https://github.com/aheissenberger/meteor-memjs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aheissenberger%2Fmeteor-memjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aheissenberger%2Fmeteor-memjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aheissenberger%2Fmeteor-memjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aheissenberger%2Fmeteor-memjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aheissenberger","download_url":"https://codeload.github.com/aheissenberger/meteor-memjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244959450,"owners_count":20538626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-28T23:07:45.752Z","updated_at":"2026-05-09T13:02:42.989Z","avatar_url":"https://github.com/aheissenberger.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aheissenberger:memjs\n\nA Meteor wrapper for MemJS a pure Node.js client library for using memcache, in particular, the\n[MemCachier](http://memcachier.com/) service. It\nuses the binary protocol and support SASL authentication.\n\nMemCachier is the Memcache Add-On provided by [cloudcontroll](http://www.cloudcontrolled.com) which supports Meteor hosting with a custom [buildpack](https://github.com/aheissenberger/cloudcontrol-buildpack-meteor).\n\n## Dependencies\n\n * [memjs](https://github.com/alevy/memjs) - A memcache client for node using the binary protocol and SASL authentication\n\n\n\n\n## Installation\n\nInstall using Meteor:\n\n```sh\nmeteor add aheissenberger:memjs\n```\n\n## Quick Start\n\nUsing it is straight-forward as memjs understands the\nMEMCACHIER_SERVERS, MEMCACHIER_USERNAME and MEMCACHIER_PASSWORD\nenvironment variables.\n\n```javascript\nvar client = new MemJS()\nclient.set('hello', 'world', 600);\nvar result = client.get('hello');\nconsole.log(result.toString());\n```\n\nDocumentation can be found here: [http://amitlevy.com/projects/memjs/](http://amitlevy.com/projects/memjs/)\n\n## API\n\n### Settings Values\n\n``` javascript\nclient.set('hello', 'world', 600);\n```\n\nThe `set(key, val, expiration)` function accepts the following parameters.\n\n* `key`: key to set\n* `val`: value to set\n* `expiration` [optional]: time interval, in seconds, after which memcached will expire the object\n\n*return*\n* true if successful\n* will throw an error of something goes wrong\n\n### Getting Values\n\n``` javascript\nclient.get('hello', function(err, val) {\n\n});\n```\n\nThe `get(key)` function accepts the following parameters.\n\n* `key`: key to retrieve\n\n*return*\n* value (Buffer Object) if successful - you need to convert it back to a String  \n* null if key does not exist\n* will throw an error of something goes wrong\n\n### all methodes ###\n| function | returns | description |\n| -------- | ------- | ----------- |\n| new MemJS( server, options ) | Connection Object | initializes connection to Memcachier |\n| get( key ) | value | get value for key, null if key does not exist |\n| set( key, value, expire ) | success | set/overrides value of key |\n| add( key, value, expire ) | success | set value of key, fails if key exists |\n| replace( key, value, expire ) | success | set value of key, fails if key exists |\n| delete( key ) | success | deletes key |\n| increment( key, amount, expire ) | value | returns the value after the increment |\n| decrement( key, amount, expire ) | success | returns the value after the decrement - success if OK - this is different to increment!! |\n| stats( ) | {server, stats} | Fetches memcache stats from each connected server |\n| flush( ) | {lastErr, results} | Flushes the cache on each connected server |\n| close( ) | success | Closes connections to all the servers |\n\n*input:* `value` will allways coverted to string - you can change this with this [option](#specific-option-of-the-wrapper)\n*output:* `value` will allways be a Buffer Value - use to String to covert it\n\n`expire` is optional, default can be set as option of `new MemJS` call\n\n## Configuration ##\n\nMemJS understands the following environment variables:\n\n* `MEMCACHIER_SERVERS` - used to determine which servers to connect to. Should be a comma separated list of _[hostname:port]_.\n* `MEMCACHIER_USERNAME` - if present with `MEMCACHIER_PASSWORD`, MemJS will try to authenticated to the server using SASL.\n* `MEMCACHIER_PASSWORD` - if present with `MEMCACHIER_USERNAME`, MemJS will try to authenticated to the server using SASL.\n* `MEMCACHE_USERNAME` - used if `MEMCACHIER_USERNAME` is not present\n* `MEMCACHE_PASSWORD` - used if `MEMCACHIER_PASSWORD` is not present\n\nEnvironment variables are only used as a fallback for explicit parameters.\n\n### specific Option of the Wrapper ###\n``` javascript\nvar client = new MemJS('USERNAME:PASSWORD@SERVER:PORT',{EJSON:true});\n```\n\nThe `EJSON:true` allows to store and retrieve Javascript Objects - please check Meteor [EJSON](http://docs.meteor.com/#/full/ejson) for more information.\n`$ meteor add ejson` is required to use this option\n\n## Changelog\n\n### v0.0.3\n * fix memjs.js loading on client\n\n### v0.0.2\n * Convert Numbers to Strings\n\n### v0.0.1\n * Initial release\n\n\n## Copyright and license\n\nCopyright © 2015 [Andreas Heissenberger](http://www.heissenberger.at)\n\n_aheissenberger:memjs_ is licensed under the [**MIT**](http://aheissenberger.mit-license.org) license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faheissenberger%2Fmeteor-memjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faheissenberger%2Fmeteor-memjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faheissenberger%2Fmeteor-memjs/lists"}