Welcome to Ofis Documentation
Comprehensive documentation for the Ofis platform. Learn how to install, configure, and use Ofis effectively with our detailed guides and examples.
Quick Start
Get up and running with Ofis in minutes. This guide will walk you through the basic installation and configuration steps.
npm install @tailwindlabs/cache-advance Installing Dependencies
Before you can use Ofis, you need to install the required dependencies. Make sure you have Node.js version 16 or higher installed.
npm install ofis @ofis/core @ofis/utils yarn add ofis @ofis/core @ofis/utils pnpm add ofis @ofis/core @ofis/utils Configuring the Library
Once installed, you need to configure Ofis to work with your application. Create a configuration file in your project root.
Your First Cache
Setting up your first cache is simple. Here's a basic example of how to create and use a cache with Ofis.
import { createCache } from 'ofis';
const cache = createCache({
maxAge: 3600,
maxSize: 1000,
});
cache.set('user:123', userData);
const user = cache.get('user:123'); Clearing the Cache
Learn how to clear cache entries manually or set up automatic cleanup.
// Clear specific key
cache.delete('user:123');
// Clear all cache
cache.clear();
// Clear with pattern
cache.clearPattern('user:*'); Adding Middleware
Extend Ofis functionality with custom middleware for logging, validation, and more.
const loggingMiddleware = (key, value) => {
console.log(`Cache set: ${key}`, value);
return value;
};
cache.use('set', loggingMiddleware); Oh no! Something bad happened!
This is what a disclaimer message looks like. You might want to include inline code in it. Or you'll want to include a link in it. I don't think we should get too carried away with other scenarios like lists or tables — that would be silly.
Getting Help
If you run into issues or have questions, there are several ways to get help.
Submit an Issue
Found a bug or have a feature request? Submit an issue on our GitHub repository.
https://github.com/ofis/docs/issues Join the Community
Connect with other Ofis users, share your experiences, and get help from the community.