cache-blister-dependencies
v1.1.1
Published
Uses a configuration to cache all the specified services in a container
Downloads
279
Readme
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
- Fork it:
git clone https://github.com/softonic/cache-blister-dependencies.git
- Create your feature branch:
git checkout -b feature/my-new-feature
- Commit your changes:
git commit -am 'Added some feature'
- Check the build:
npm run build
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D