New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@types/memory-cache

Package Overview
Dependencies
Maintainers
0
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/memory-cache

TypeScript definitions for memory-cache

  • 0.2.6
  • ts4.8
  • ts4.9
  • ts5.0
  • ts5.1
  • ts5.2
  • ts5.3
  • ts5.4
  • ts5.5
  • ts5.6
  • ts5.7
  • ts5.8
  • ts5.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
76K
decreased by-8.31%
Maintainers
0
Weekly downloads
 
Created
Source

Installation

npm install --save @types/memory-cache

Summary

This package contains type definitions for memory-cache (https://github.com/ptarjan/node-cache).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/memory-cache.

index.d.ts

// Originally imported from: https://github.com/soywiz/typescript-node-definitions/memory-cache.d.ts

export class CacheClass<K, V> {
    put(key: K, value: V, time?: number, timeoutCallback?: (key: K, value: V) => void): V;
    get(key: K): V | null;
    del(key: K): boolean;
    clear(): void;

    size(): number;
    memsize(): number;

    debug(bool: boolean): void;
    hits(): number;
    misses(): number;
    keys(): K[];

    /**
     * @returns The new size of the cache
     * @see {@link https://github.com/ptarjan/node-cache#importjson--functionjson-string-options--skipduplicates-boolean-}
     */
    importJson(json: string, options?: { skipDuplicates?: boolean | undefined }): number;
    /**
     * @returns A JSON string representing all the cache data
     */
    exportJson(): string;
}

export const Cache: typeof CacheClass;

export function put<V>(key: any, value: V, time?: number, timeoutCallback?: (key: any, value: any) => void): V;
export function get(key: any): any;
export function del(key: any): boolean;
export function clear(): void;

export function size(): number;
export function memsize(): number;

export function debug(bool: boolean): void;
export function hits(): number;
export function misses(): number;
export function keys(): any[];

/**
 * @returns The new size of the cache
 * @see {@link https://github.com/ptarjan/node-cache#importjson--functionjson-string-options--skipduplicates-boolean-}
 */
export function importJson(json: string, options?: { skipDuplicates?: boolean | undefined }): number;
/**
 * @returns A JSON string representing all the cache data
 */
export function exportJson(): string;

Additional Details

  • Last updated: Mon, 29 Jul 2024 19:36:25 GMT
  • Dependencies: none

Credits

These definitions were written by Travis Thieman.

FAQs

Package last updated on 29 Jul 2024

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