cache-blister-dependencies

1.1.1 • Public • Published

cache-blister-dependencies

Uses a configuration to cache all the specified services in a container.

Installation

npm install cache-blister-dependencies

Usage

import cacheBlisterDependencies from 'cache-blister-dependencies';

container.service('articleRepository', () => { return new ArticleRepository(); });
container.value('getSomethingExpensive', getSomethingExpensive);

const config = {
  options: {
    ttl: '4h'
  },
  entries: {
    'articleRepository.getArticle': { ttl: '1h' },
    'getSomethingExpensive': { ttl: '2d' }
  }
};

const cacheClient = container.get('cacheClient');

cacheBlisterDependencies({ container, cacheClient, config });

Testing

Clone the repository and execute:

npm test

Contribute

  1. Fork it: git clone https://github.com/softonic/cache-blister-dependencies.git
  2. Create your feature branch: git checkout -b feature/my-new-feature
  3. Commit your changes: git commit -am 'Added some feature'
  4. Check the build: npm run build
  5. Push to the branch: git push origin my-new-feature
  6. Submit a pull request :D

Readme

Keywords

none

Package Sidebar

Install

npm i cache-blister-dependencies

Weekly Downloads

113

Version

1.1.1

License

Apache-2.0

Unpacked Size

12.1 kB

Total Files

7

Last publish

Collaborators

  • softonic