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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@onurege3467/fastcache

v2.0.0

Published

JSON based database and cache for Node.js applications

Readme

FastCache

A JSON-based database caching library for Node.js.

Features

  • Use JSON files as a database
  • Fast access with in-memory caching
  • CRUD (Create, Read, Update, Delete) operations
  • Asynchronous API
  • Nested data structures (with dot notation)
  • Filtering and batch operations
  • Automatic file and folder management

Installation

npm install @onurege3467/fastcache

Basic Usage

Creating a Database

const FastCache = require('@onurege3467/fastcache');

const cache = new FastCache({
  filePath: './data/cache.json', // Database file path
  cacheTime: 3600 // Cache duration (seconds) - default: 3600 (1 hour)
});

Adding Data (Set)

// Add single data
await cache.set('users.123', {
  id: 123,
  name: 'Ahmet',
  email: '[email protected]'
});

// Add nested data
await cache.set('settings.theme.colors.primary', '#3498cache');

Reading Data (Get)

// Read single data
const user = await cache.get('users.123');
console.log(user);

// Read nested data
const primaryColor = await cache.get('settings.theme.colors.primary');
console.log(primaryColor); // #3498cache

// Get all database data
const allData = await cache.getAll();
console.log(allData);

Updating Data (Update)

// Update existing data (merges objects)
await cache.update('users.123', {
  age: 28,
  country: 'Turkey'
});
// Result: users.123 now has name, email, age, and country fields

Deleting Data (Delete)

// Delete data
const deleted = await cache.delete('users.123');
console.log(deleted); // true or false

Advanced Usage

Bulk Data Addition

await cache.bulkSet({
  'users.124': { name: 'Ayşe', age: 32 },
  'users.125': { name: 'Mehmet', age: 45 },
  'settings.version': '1.0.0'
});

Filtering

// Find users older than 30
const adultUsers = await cache.filter('users', user => user.age > 30);
console.log(adultUsers);

Cache Management

// Check cache status
const isCached = cache.isCached('users.123');
console.log('Is cached:', isCached);

// Clear the entire cache
cache.clearCache();

// Refresh the cache for a specific record
await cache.refreshCache('users.123');

Statistics and Checks

// Count elements
const userCount = await cache.count('users');
console.log('User count:', userCount);

// Check existence
const exists = await cache.exists('users.123');
console.log('Does users.123 exist:', exists);

Error Handling

try {
  await cache.set('users.123', { name: 'Ahmet' });
} catch (err) {
  console.error('Database error:', err.message);
}