@turist/promise-cache
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

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;
})

Readme

Keywords

none

Package Sidebar

Install

npm i @turist/promise-cache

Weekly Downloads

857

Version

0.0.2

License

MIT

Unpacked Size

4.47 kB

Total Files

5

Last publish

Collaborators

  • olliv
  • jamo