
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@keyv/memcache
Advanced tools
Memcache storage adapter for Keyv
npm install --save @keyv/memcache
or
yarn add @keyv/memcache
import Keyv from 'keyv';
import KeyvMemcache from '@keyv/memcache';
const memcache = new KeyvMemcache('user:pass@localhost:11211');
const keyv = new Keyv({ store: memcache });
//set
await keyv.set("foo","bar", 6000) //Expiring time is optional
//get
const obj = await keyv.get("foo");
//delete
await keyv.delete("foo");
//clear
await keyv.clear();
import Keyv from 'keyv';
import KeyvMemcache from '@keyv/memcache';
const memcache = new KeyvMemcache('user:pass@localhost:11211');
const keyv1 = new Keyv({ store: memcache, namespace: "namespace1" });
const keyv2 = new Keyv({ store: memcache, namespace: "namespace2" });
//set
await keyv1.set("foo","bar1", 6000) //Expiring time is optional
await keyv2.set("foo","bar2", 6000) //Expiring time is optional
//get
const obj1 = await keyv1.get("foo"); //will return bar1
const obj2 = await keyv2.get("foo"); //will return bar2
//set the server to the correct address and port
const server = "localhost:11211"
const Keyv = require("keyv");
const KeyvMemcache = require("@keyv/memcache");
const memcache = new KeyvMemcache(server);
const keyv = new Keyv({ store: memcache});
//best practice is to not hard code your config in code.
const user = "";
const pass = "";
const server = "XXX.XXX.XXX.memcachier.com:11211"
const Keyv = require("keyv");
const KeyvMemcache = require("@keyv/memcache");
const memcache = new KeyvMemcache(user +":"+ pass +"@"+ server);
const keyv = new Keyv({ store: memcache});
Protocol
to memcachedendpoint
(the server) and place it into your code:
//best practice is to not hard code your config in code.
const user = "";
const pass = "";
const server = "XXX.XXX.XXX.XXX.cloud.redislabs.com:XXX"
const Keyv = require("keyv");
const KeyvMemcache = require("@keyv/memcache");
const memcache = new KeyvMemcache(user +":"+ pass +"@"+ server);
const keyv = new Keyv({ store: memcache});
import Keyv from 'keyv';
import KeyvMemcache from '@keyv/memcache';
const memcache = new KeyvMemcache("insert the internal google memcached discovery endpoint");
const keyv = new Keyv({ store: memcache});
FAQs
Memcache storage adapter for Keyv
The npm package @keyv/memcache receives a total of 149,652 weekly downloads. As such, @keyv/memcache popularity was classified as popular.
We found that @keyv/memcache demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.