1.3.4 • Published 1 year ago
always-up v1.3.4
Installation
To install the package, use:
npm i always-upUI Component
To use the UI component in a React application:
Import the
CachingPopupcomponent:import { CachingPopup } from "always-up/cachingpopup";Use it directly as a React component:
<CachingPopup />
Middleware
To use the middleware in your server application:
Import the
createCacheMiddlewarefunction:import { createCacheMiddleware } from "always-up/createcachemiddleware";In
server.js, create and use the cache middleware:const cacheMiddleware = createCacheMiddleware( { maxMemorySizeInMB: 350, upperMemoryLimitPercentage: 97, lowerMemoryLimitPercentage: 75, syncToDiskIntervalInSeconds: 60, storageFilePath: "path/to/cache.json", //Path to Where file is to be stored }, "path/to/cache.log", //Log File Path "path/to/alwaysUpConfig.json" //Log to UI Configs ); app.use(cacheMiddleware);