UNPKG

@amaui/cache

Version:
92 lines (63 loc) 1.37 kB
</br > </br > <p align='center'> <a target='_blank' rel='noopener noreferrer' href='#'> <img src='utils/images/logo.svg' alt='AMAUI logo' /> </a> </p> <h1 align='center'>AMAUI Cache</h1> <p align='center'> Cache </p> <br /> <h3 align='center'> <sub>MIT license&nbsp;&nbsp;&nbsp;&nbsp;</sub> <sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub> <sub>UMD 4.2kb gzipped&nbsp;&nbsp;&nbsp;&nbsp;</sub> <sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub> <sub>Browser and Nodejs</sub> </h3> <p align='center'> <sub>Very simple code&nbsp;&nbsp;&nbsp;&nbsp;</sub> <sub>Modern code&nbsp;&nbsp;&nbsp;&nbsp;</sub> <sub>Junior friendly&nbsp;&nbsp;&nbsp;&nbsp;</sub> <sub>Typescript&nbsp;&nbsp;&nbsp;&nbsp;</sub> <sub>Made with :yellow_heart:</sub> </p> <br /> ## Getting started ### Add ```sh // yarn yarn add @amaui/cache // npm npm install @amaui/cache ``` ### Use ```javascript import AmauiCache from '@amaui/cache'; const args = [4, { a: 4, ab: 4 }]; // Args is made into a hash, which makes the key // a very useful, when you wanna cache a value based // on some complex amount of variables AmauiCache.add(4, ...args); AmauiCache.get(...args); // Output // 4 ``` ### Dev Install ```sh yarn ``` Test ```sh yarn test ``` ### Prod Build ```sh yarn build ``` ### Docs Might be soon...