{"repo":"roccomuso/memorystore","free":true,"listed":false,"github":"https://github.com/roccomuso/memorystore","clone":"git clone https://github.com/roccomuso/memorystore.git","description":"express-session full featured MemoryStore layer without leaks!","language":"JavaScript","stars":121,"topics":["express","memorystore","session","sessions","memory","noleak","cache"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"memorystore express-session full featured MemoryStore module without leaks! A session store implementation for Express using lru-cache. The default MemoryStore from express-session can leak memory because it does not provide a suitable way to expire sessions. The sessions are still stored in memory, so they're not shared with other processes or services. Setup $ npm install express-session memorystore Pass the express-session store into memorystore to create a MemoryStore constructor. Options checkPeriod Defines how often MemoryStore checks for expired entries. The period is in ms. The automatic check is disabled by default. Not setting this is kind of silly, since that's the whole purpose of this library. max The maximum size of the cache, checked by applying the length function to all values in the cache. It defaults to Infinity . ttl Session TTL (expiration) in milliseconds. Defaults to session.cookie.maxAge (if set), or one day. This may also be set to a function of the form (options, sess, sessionID) = number . dispose Function that is called on sessions when they are dropped from the cache. This can be handy if you want to close file descriptors or do other cleanup tasks when sessions are no longer accessible. Called with key, value . It's called before actually removing the item from the internal cache, so if you want to immediately put it back in, you'll have to do that in a nextTick or setTimeout callback or it won't do anything. stale By default, if you set a maxAge","default_branch":null,"files":null,"tree":[],"storefront":"/r/roccomuso","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/roccomuso/memorystore/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}