Skip to content

0k/cache

Repository files navigation

Typescript cache decorator

This packages holds a cache decorator implementation. It draws its inspiration on kids.cache a python simple yet powerful cache decorator.

This implementation leverage decorator in typescript to reach same goals:

  • no dependencies
  • cache clearing support

Its still in infancy and lacks:

  • support for normal function (only methods and properties are cachable)
  • cache stats
  • 100% coverage
  • doc

Adding @0k/cache to your project

From the root of your project:

npm install --save @0k/cache

Or better, as @0k/cache is still in early release,

npm install --save @0k/cache#master

To be sure to get the latest version, relaunch this last command whenever you want to update.

Contributing to @0k/cache

This package is using npm to track dependendies, so you can install them with:

npm install

As this package is written in typescript. You can transpile to javascript and transpile on file change with:

## Compile and watch
npx tspc -w

Tests are managed through vitest

## Run test once
npm run test

Note that you can also use npx vitest command to launch tests in watch mode.

About

Kids cache typescript implementation

Resources

License

Stars

Watchers

Forks

Packages

No packages published