Kasza.js
Kasza.js is simple Cache service/helper/tool for your App.
Getting Started
Prerequisites
This package is using UMD pattern, so it means that you can use it:
- in Node.js project
- browser running project
- without AMD
- with AMD
Installation
npm
Option A: With npm install kasza-js
Option B: Download
Download version that fits your better:
And simply add HTML tag:
Usage
Basic set and get
// set value 'kiszony' for id 'ogorek'Kasza; // get value for id 'ogorek'Kasza; // will return 'kiszony'
What's special about it? Well, you can use it as storage between files. Example:
In file1.js
:
var commonData = key: value { return true; }; Kasza;
In file2.js
:
var commonData = Kasza;
Use TTL (Time To Live)
In file1.js
:
var temporaryData = 1 2 3; // set TTL to 1 minute (60,000ms)Kasza;
In file2.js
:
var temporaryData = Kasza; // will return proper data ;
Use Debug
Enable/Disable Debug
Kasza;
Use custom debug function
Kasza
TODO
- save Cache in IndexedDB (if user wishes to)
FAQ
-
Why "Kasza"? What does it mean? How should I even pronounce it?!
Kasza is Polish word and means groats, kasha. According to Wiktionary it's pronounced /ˈka.ʂa/.
Why? Well - because for kasza for me sounds simmilar to cache. That's all 😊
Authors
- Marek Sierociński - Initial work - marverix
See also the list of contributors who participated in this project.
License
This project is licensed under the MIT License - see the LICENSE.md file for details