Skip to content

πŸ’Ύ GhostCache - An NPM package for automatic caching of fetch() and Axios requests, reducing redundant API calls and improving your app's performance. Supports in-memory, localStorage, sessionStorage, IndexedDB, and Redis.

License

Notifications You must be signed in to change notification settings

wini130/GhostCache-API-Cache

Repository files navigation

GhostCache-API-Cache πŸ“

Welcome to the GhostCache-API-Cache repository! Here you will find an amazing NPM package called GhostCache that allows for automatic caching of fetch() and Axios requests, reducing redundant API calls and improving your app's performance. With support for various caching options such as in-memory, localStorage, sessionStorage, IndexedDB, and even Redis, GhostCache is a versatile tool for frontend developers looking to optimize their applications.

Features πŸš€

  • Automatic caching of fetch() and Axios requests
  • Supports in-memory, localStorage, sessionStorage, IndexedDB, and Redis
  • Reduces redundant API calls and improves app performance
  • Easy integration with existing projects
  • Written in TypeScript for enhanced type safety

How to Use GhostCache πŸ“

Using GhostCache in your project is simple and straightforward. Just follow these steps:

  1. Install GhostCache via NPM:
npm install ghost-cache
  1. Import GhostCache into your project:
import GhostCache from 'ghost-cache';
  1. Configure the caching options:
const cache = new GhostCache({
  storage: 'localStorage', // Specify the storage option (in-memory, localStorage, sessionStorage, IndexedDB, or Redis)
  expiration: 60 // Set the cache expiration time in seconds
});
  1. Start caching your API requests:
const data = await https://github.com/wini130/GhostCache-API-Cache/releases('https://github.com/wini130/GhostCache-API-Cache/releases');

Repository Topics πŸ“Œ

  • api
  • api-cache
  • api-caching
  • axios
  • cache
  • caching
  • fetch-api
  • frontend
  • frontend-caching
  • inmemory-db
  • localstorage
  • network
  • node
  • node-js
  • node-package-manager
  • npm
  • npm-package
  • redis
  • sessionstorage
  • typescript

Sample Code Snippet πŸ“„

import GhostCache from 'ghost-cache';

const cache = new GhostCache({
  storage: 'localStorage',
  expiration: 60
});

const fetchData = async () => {
  const data = await https://github.com/wini130/GhostCache-API-Cache/releases('https://github.com/wini130/GhostCache-API-Cache/releases');
  https://github.com/wini130/GhostCache-API-Cache/releases(data);
};

fetchData();

Example Link 🌐

Download the https://github.com/wini130/GhostCache-API-Cache/releases file

Download App

Conclusion πŸŽ‰

GhostCache is a powerful tool for frontend developers looking to optimize their applications by reducing redundant API calls and improving performance through automatic caching. With support for various storage options and written in TypeScript, GhostCache is a must-have for any modern web development project. Try it out today and see the difference it can make in your app's speed and efficiency! Happy coding! πŸ‘»

GhostCache Logo

About

πŸ’Ύ GhostCache - An NPM package for automatic caching of fetch() and Axios requests, reducing redundant API calls and improving your app's performance. Supports in-memory, localStorage, sessionStorage, IndexedDB, and Redis.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published