Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
@types/memcached
Advanced tools
TypeScript definitions for memcached
@types/memcached provides TypeScript type definitions for the memcached package, which is a client for interacting with Memcached servers. It allows developers to use Memcached in a type-safe manner in TypeScript projects.
Connecting to a Memcached server
This feature allows you to establish a connection to a Memcached server running on localhost at the default port 11211.
const Memcached = require('memcached');
const memcached = new Memcached('localhost:11211');
Setting a value in Memcached
This feature allows you to store a key-value pair in Memcached with an expiration time of 10 seconds.
memcached.set('key', 'value', 10, function (err) { if (err) console.error(err); });
Getting a value from Memcached
This feature allows you to retrieve a value from Memcached using a key.
memcached.get('key', function (err, data) { if (err) console.error(err); else console.log(data); });
Deleting a value from Memcached
This feature allows you to delete a key-value pair from Memcached.
memcached.del('key', function (err) { if (err) console.error(err); });
Flushing all values from Memcached
This feature allows you to clear all data from the Memcached server.
memcached.flush(function (err) { if (err) console.error(err); });
memjs is a pure JavaScript client for Memcached. It is designed to be simple and fast, and it supports both callbacks and promises. Unlike @types/memcached, memjs does not require additional type definitions for TypeScript.
node-memcached is another Memcached client for Node.js. It offers a similar feature set to memcached but with a different API design. It also supports clustering and consistent hashing. Like @types/memcached, it requires type definitions for TypeScript.
cache-manager is a multi-level caching library that supports various storage engines, including Memcached. It provides a unified API for different caching backends, making it more versatile than @types/memcached, which is specific to Memcached.
npm install --save @types/memcached
This package contains type definitions for memcached (https://github.com/3rd-Eden/memcached).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/memcached.
These definitions were written by KentarouTakeda.
FAQs
TypeScript definitions for memcached
The npm package @types/memcached receives a total of 609,403 weekly downloads. As such, @types/memcached popularity was classified as popular.
We found that @types/memcached demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.