Skip to content

turist-cloud/promise-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

promise-cache

Easily convert time to milliseconds

Examples

import promiseCache from "@turist/promise-cache"

const LRU = require('lru-cache')
const ms = require('ms')

const cache = new LRU({
	max: 100,
	maxAge: ms('5s')
})

const getData = promiseCache(cache, async (args1, args2) => {
	// ... do async stuff

	return something;
})

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks