A TypeScript utility for caching results of method executions.
class {
@cache()
async foo() {
// ...
}
}
Install using npm
or other package managers:
npm install 1ib/cache
Import into your Node.js project:
// CommonJS
const { cache } = require("1ib/cache")
// ESM
import { cache } from "1ib/cache"
Install using JSR:
deno add 1ib/cache
#or
jsr add 1ib/cache
Then import into your Deno project:
import { cache } from "1ib/cache"
Install using this command:
bun add 1ib/cache
Import into your Bun project:
import { cache } from "1ib/cache"
It's recommended to import the minified version to save bandwidth:
import { cache } from "https://cdn.skypack.dev/1ib/cache?min"
However, you can also import the unminified version for debugging purposes:
import { cache } from "https://cdn.skypack.dev/1ib/cache"
This project is licensed under the MIT.