Package Exports
- @memzy/node-sdk
- @memzy/node-sdk/dist/Memzy.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@memzy/node-sdk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@memzy/node-sdk
Memzy: Straightforward Memory Caching for Node.js
Memzy is a no-nonsense, easy-to-integrate memory cache client for Node.js developers. It offers a reliable way to handle in-memory caching for improved application performance.
Installation
npm install @memzy/node-sdkUsage
import Memzy from "@memzy/node-sdk";
const memzy = new Memzy({
apiKey: "your-api-key",
region: "atlanta",
});
console.log('Setting key "testKey" to "Hello, Memzy!"');
await memzy.Set("testKey", "Hello, Memzy!");
console.log('Getting value for key "testKey"');
const value = await memzy.Get("testKey");
console.log("Value:", value);
console.log('Deleting key "testKey"');
await memzy.Del("testKey");
console.log('Attempting to get deleted key "testKey"');
try {
const deletedValue = await memzy.Get("testKey");
console.log("Value:", deletedValue);
} catch (error) {
console.log("Expected error:", error.message);
}
console.log('Subscribing to "testEvent"');
memzy.Subscribe("testEvent", (data) => {
console.log('Received data from "testEvent":', data);
});
console.log('Publishing event "testEvent" with data "This is a test event"');
await memzy.Publish("testEvent", "This is a test event");