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

koatty_cacheable

Package Overview
Dependencies
Maintainers
0
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koatty_cacheable

Cacheable for koatty.

  • 1.6.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-66.67%
Maintainers
0
Weekly downloads
 
Created
Source

koatty_cacheable

Cacheable for koatty.

Koatty框架的 CacheAble, Cacheable, CacheEvict 支持库

Usage

db.ts in koatty project:

export default {
    ...

    "CacheStore": {
        type: "memory", // redis or memory, memory is default
        // key_prefix: "koatty",
        // host: '127.0.0.1',
        // port: 6379,
        // name: "",
        // username: "",
        // password: "",
        // db: 0,
        // timeout: 30,
        // pool_size: 10,
        // conn_timeout: 30
    },

    ...
};

used in service:

import { CacheAble, CacheEvict, GetCacheStore } from "koatty_cacheable";

export class TestService {

    @CacheAble("testCache") // auto cached
    getTest(){
        //todo
    }

    @CacheEvict("testCache") // auto clear cache
    setTest(){
        //todo
    }

    test(){
        const store = GetCacheStore(this.app);
        store.set(key, value);
    }
}

Keywords

FAQs

Package last updated on 07 Nov 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