Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

memcached-typed

Package Overview
Dependencies
Maintainers
3
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

memcached-typed

Typescript cached fetching helper

  • 7.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
41
decreased by-56.38%
Maintainers
3
Weekly downloads
 
Created
Source

Memcached-Typed

Build Status

npm install memcached-typed --save

  1. Support Promise for every method
  2. Support for get / set methods
  3. Advanced cache-access pattern such as fetch.
describe("#fetchMulti", () => {
  const memcached = new Memcached();
  const fetcher = new MemcachedFetcher(memcached);

  it("should fetch only missing sets", async () => {
    const res1 = await fetcher.multiFetch(
      [1, 2, 3, 4, 5],
      (arg) => `v1-${arg}`,
      3600,
      async (args) => {
        return args.map((arg) => arg * arg);
      }
    );
    expect(res1).to.deep.eq([1, 4, 9, 16, 25]);

    // it's using same hash key, so should reuse cache for exsiting values
    const res2 = await fetcher.multiFetch(
      [1, 2, 100, 200, 5],
      (arg) => `v1-${arg}`,
      3600,
      async (args) => {
        return args.map((arg) => arg + arg);
      }
    );
    expect(res2).to.deep.eq([1, 4, 200, 400, 25]);

    const res3 = await fetcher.multiFetch(
      [],
      (arg) => `v1-${arg}`,
      3600,
      async (args) => {
        return args.map((arg) => arg);
      }
    );
    expect(res3).to.deep.eq([]);
  });
});

AWS Elasticache autoDiscovery

this only supports > 1.4.14

FAQs

Package last updated on 30 Jan 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc