npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@micl/server-racache

v0.0.3

Published

Provides time-sensitive caching with local file snapshot storage.

Downloads

6

Readme

micl-server-racache

Provides time-sensitive caching with local file snapshot storage.

Features

  1. Provides time-sensitive cache retrieval and storage.
  2. Works in-memory and supports local file snapshots for storage.
  3. API available for managing cache and snapshot storage.

API

MraCache Namespace

MraCacheOptionInterface

  • expireTime: Default expiration time.
  • storePath: Default path for local snapshot storage.
interface MraCacheOptionInterface {
  expireTime: string;
  storePath: string;
}

config(options: MraCacheOptionInterface): void

  • Description: Updates global configuration settings.
  • Parameters: options — Configuration options as defined in MraCacheOptionInterface.
function config(options: MraCacheOptionInterface): void;

get(key: string): T

  • Description: Retrieves data from the cache.
  • Parameters: key — A unique identifier for the cached data.
  • Returns: The cached data of type T.
function get<T>(key: string): T;

set(data: T): string

  • Description: Stores data in the cache.
  • Parameters: data — Data to be stored in the cache.
  • Returns: A unique identifier for the stored data.
function set<T>(data: T): string;

set(key: string, data: T, expireTime?: string): string

  • Description: Stores data in the cache with a specific expiration time.
  • Parameters:
    • key — A unique identifier for the cached data.
    • data — Data to be stored in the cache.
    • expireTime (optional) — Expiration time in the format 1d, 1h, 1m.
  • Returns: A unique identifier for the stored data.
function set<T>(key: string, data: T, expireTime?: string): string;

remove(key: string): string | undefined

  • Description: Removes data from the cache.
  • Parameters: key — The unique identifier for the data to be removed.
  • Returns: A unique identifier for the removed data, or undefined if not found.
function remove(key: string): string | undefined;

store(path?: string): boolean

  • Description: Saves the current cache data as a snapshot.
  • Parameters: path (optional) — The storage path for the snapshot.
  • Returns: true if the snapshot was successfully saved, false otherwise.
function store(path?: string): boolean;

load(path: string): void

  • Description: Loads a snapshot from a specified path.
  • Parameters: path — The path from which to load the snapshot.
function load(path: string): void;

Configuration

MraCacheOptionInterface

  • expireTime: The default expiration time for cached data (e.g., 1d, 1h, 1m).
  • storePath: The default directory where cache snapshots are stored.

Example:

{
      "expireTime": "1d", 
      "storePath": "/test/test.json"
}

Usage

  1. Install the Package:

    Use npm or yarn to install the package.

    npm install micl-server-racache
  2. Import and Use in Your Project:

    const MraCache = require('micl-server-racache');
    
    // Configure cache
    MraCache.config({
      expireTime: '1d',
      storePath: './cache-snapshots.json'
    });
    
    // Set data in cache
    MraCache.set('user_data', { name: 'John Doe', age: 30 });
    
    // Get data from cache
    const userData = MraCache.get('user_data');
    
    // Save cache snapshot
    MraCache.store('./cache-snapshots.json');
       
    // Load cache snapshot
    MraCache.load('./cache-snapshots.json');

Contributing

You can contribute to this module online via CodeSandBox, or locally:

  1. Clone the repository.
  2. Install dependencies with yarn install or npm install.
  3. Start the development server using yarn dev or npm run dev.

License

This project is licensed under the MIT License.

Copyright (c) alexgogoing [email protected]