This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@boredland/node-ts-cache-storage-elasticsearch
TypeScript icon, indicating that this package has built-in type declarations

6.0.1 • Public • Published

node-ts-cache-storage-elasticsearch

ElasticSearch storage module for node-ts-cache.

This module expects you to bring your own instance of ElasticSearch.

yarn add @boredland/node-ts-cache @boredland/node-ts-cache-storage-elasticsearch
import { ElasticSearchStorage } from "@boredland/node-ts-cache-storage-elasticsearch"
import { Cache, CacheContainer } from "@boredland/node-ts-cache"
import { Client } from "@elastic/elasticsearch";

const client = new Client({
    node: "http://localhost:9200",
    Connection: mock.getConnection(),
});

const storage = new ElasticSearchStorage(indexName, client);

const userCache = new CacheContainer(storage)

class MyService {
    @Cache(userCache, { ttl: 60 })
    public async getUsers(): Promise<string[]> {
        return ["Max", "User"]
    }
}

Package Sidebar

Install

npm i @boredland/node-ts-cache-storage-elasticsearch

Weekly Downloads

0

Version

6.0.1

License

MIT

Unpacked Size

8.27 kB

Total Files

10

Last publish

Collaborators

  • jonasstr