https://github.com/softonic/cache-blister-dependencies
Uses a configuration to cache all the specified services in a container
https://github.com/softonic/cache-blister-dependencies
Last synced: 4 months ago
JSON representation
Uses a configuration to cache all the specified services in a container
- Host: GitHub
- URL: https://github.com/softonic/cache-blister-dependencies
- Owner: softonic
- License: other
- Created: 2016-11-13T11:51:19.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-12-02T18:11:52.000Z (over 3 years ago)
- Last Synced: 2025-12-05T06:52:37.529Z (6 months ago)
- Language: JavaScript
- Size: 182 KB
- Stars: 1
- Watchers: 18
- Forks: 1
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cache-blister-dependencies
Uses a configuration to cache all the specified services in a container.
## Installation
```bash
npm install cache-blister-dependencies
```
## Usage
```javascript
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:
```bash
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`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D