An open API service indexing awesome lists of open source software.

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

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