fridge – Offline Data Storage. Stores Something, Everywhere.
It makes use of localStorage, indexedDB, and webSQL backends as key-value retailer database to retailer knowledge regionally within the internet browser. It wraps all of them utilizing a quick, cross-browser localStorage-like API and shops a really wide selection of information sorts in essentially the most optimum means attainable, all over the place.
It makes use of all of the out there internet storage backends. If one is full, it routinely shops in one other.
It checks the information kind, after which chooses the one that provides the very best performance, which makes fridge the primary of its sort.
You possibly can head to our web site to learn extra: fridge
Why use fridge?
Net browsers offers some ways to retailer knowledge regionally within the browser, however it’s very sophisticated, there are lots of complications, many bugs, some has restricted storage help, some has damaged buggy implementations, and so they all include limitations, you possibly can’t retailer this and you may’t retailer that. Even skilled internet builders wrestle on this.
There are a lot of internet storage libraries that resolve these points, however very massive in dimension, and so they don’t have the luxurious of utilizing the optimum storage based mostly on knowledge kind, which makes them slower than fridge, akin to localForage. And a few offers wrappers round sure storage expertise, however with bugs, and requires storage polyfills. If you wish to retailer a picture or an audio file, it’s a must to use a really large library to do a easy job.
For these causes, JaguarScript constructed fridge.js, an especially light-weight and production-ready alternative for localStorage and localForage. It’s quick, the lightest multi-backend storage ever made, good for cell, cross-browser, and it does the offline internet storage job completely.
- World’s Lightest: The World’s lightest multi-backend internet storage library on the planet. It’s simply 7.8kb minified, 3.4kb gzipped.
How is that this even attainable? A well-thought-out mechanism that simply works.
- Multi-backend: Makes use of localStorage, indexedDB, and webSQL backends to retailer knowledge offline regionally within the internet browser. Not simply that, these 3 drivers works as one. It’s triple-driver one-channal. Considered one of a sort.
- Cross-browser: Works all over the place, on any browser and on any gadget: Chrome, Safari, Firefox, IE, Edge, Opera, and others together with outdated cell browsers, akin to HTC browser and Blackberry browser.
- localStorage-like API: Complicated database calls wrapped in a robust async localStorage-like constant API. It has config(), setItem(), getItem(), every(), removeItem(), clear(), and keys().
- Key-value: Key-value storage kind. fridge makes use of client-side databases as setter and getter offline knowledge storage.
- Stores Something: String, Quantity, Array, Object, Blob, File, TypedArrays (Int8Array, Int16Array, Int32Array, Uint8Array, Uint8ClampedArray, Uint16Array, Uint32Array, Float16Array, Float32Array), DataView.
Should you haven’t observed but, fridge shops a really wide selection of information sorts, not even localForage can retailer these a lot of information sorts.
- Characteristic-detection Assessments: It does superior databases feature-detection assessments to find out their strengths and weaknesses, not simply their fundamental help, so that you don’t have to fret about something, when storing something. fridge offers final person expertise.
- Quick Serializer: When crucial, fridge makes use of quick knowledge serializer for compatibility causes, so all knowledge sorts are supported in each storage backend, it might even retailer small Blobs in localStorage driver.
- Sensible Auto Mode: Behind-the-scenes, fridge checks to see which storage applied sciences are supported by the browser, and makes use of all of the out there backends.
Not simply that, it checks the information kind, after which chooses the one that provides the very best performance, and it offers a correct fallback as properly, which makes fridge the primary of its sort.
For instance: for those who retailer a string, it chooses localStorage. Should you retailer a Blob file, it chooses indexedDB. And If one storage was full, It’s going to fallback to a different storage backend routinely.
We’re not completed simply but, If each indexedDB and webSQL had been supported by the browser, It chooses the sooner one.
- Simplified Error Dealing with: Simplified error dealing with, no problems.
- Full On Its Personal: Some internet browsers absolutely help indexedDB, some partially help it, and a few has buggy implementations, akin to Safari. With fridge, you don’t have to supply any further sluggish and huge polyfills, akin to indexedDBShim polyfill (141 KB), to repair these points.
Full documentation accommodates Set up, Utilization, API, Supported Data Varieties, Browser Help, and Notes and Professional-tips are included within the bundle.
Go to Product Web page
Google Chrome (4+), Mozilla Firefox (3.5+), Apple Safari (4+), Opera (10.5+), Microsoft Edge (all), Web Explorer (8+) and others together with outdated cell browsers, akin to HTC browser and Blackberry browser.