Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikemajesty/nestjs-node-cache
Nestjs node cache module
https://github.com/mikemajesty/nestjs-node-cache
nest nestjs nestjs-cache node-cache node-cache-nestjs
Last synced: about 1 month ago
JSON representation
Nestjs node cache module
- Host: GitHub
- URL: https://github.com/mikemajesty/nestjs-node-cache
- Owner: mikemajesty
- Created: 2022-03-21T23:25:53.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-03-24T00:55:43.000Z (almost 3 years ago)
- Last Synced: 2024-12-03T07:39:52.939Z (about 1 month ago)
- Topics: nest, nestjs, nestjs-cache, node-cache, node-cache-nestjs
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/nestjs-node-cache
- Size: 68.4 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Nestjs Node Cache
```bash
$ npm i nestjs-node-cache
```## Usage
---
```ts
import { CacheModule } from 'nestjs-node-cache';@Module({
imports: [CacheModule],
providers: [],
exports: [],
})
export class YourModule {}
``````ts
import { ICacheService } from 'nestjs-node-cache'
@Injectable()
export class YourService {
constructor(private readonly cacheService: ICacheService) {}async method(): string {
this.cacheService.set('KEY', 'textCached');return this.cacheService.get('KEY')
}
}
```# operators
```ts
nodeCache: NodeCache
connect(config?: NodeCache.Options): CacheService
set(key: string | number, model: unknown): boolean
mSet(model: CacheType[]): boolean
mGet(key: string[]): unknown | null
has(key: string | number): boolean
del(key: string | number): boolean
get(key: string | number): unknown
setExpiration(key: string | number, ttl: number): boolean
setOptions(options: NodeCache.Options): void
```---
The following is a list of all the people that have contributed to nestjs-node-cache. Thanks for your contributions!
[](https://github.com/mikemajesty)
## License
It is available under the MIT license.
[License](https://opensource.org/licenses/mit-license.php)