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

@izara_project/izara-core-library-stored-cache

v1.0.8

Published

Shared stored cache logic

Readme

izara-core-library-stored-cache

update version

  • commit code first npm version patch || npm version minor || npm version major

can also push to repo ..

git push

make sure commits look correct

push to npm

npm publish

update project that uses this package

npm update @izara_project/izara-core-library-stored-cache

StoredCache SharedLib Usage

This document describes how to use the storedCacheSharedLib library for managing cache status and related data in DynamoDB tables.

Features

  • Check cache status in a DynamoDB table.
  • Mark cache records as complete.
  • Optionally delete related data tables when completing cache, based on uniqueRequestId.

Usage Examples

1. Check Stored Cache Status

Checks the status of a cache record in the cacheMain table.

let [cacheStatus, cacheMain] = await storedCacheSharedLib.checkStoredCacheStatus(
  _izContext,
  "cacheMain", // DynamoDB table name
  { idKey: "001002003" }, // Key values
  { settings: {} },        // Additional attributes when creating
  'testStoredCache',       // Prefix
  [],                      // Attributes to remove
  [],                      // Data tables to delete on expired
  [],                      // Errors found
  uniqueRequestId,         // Overwrite unique request ID
  false,                   // Do not create if not exists
  null,                    // Overwrite expiry interval
  false                    // Overwrite existing cache
);

Behavior:

  • If no record exists, returns process.
  • If a record exists and is not expired, returns processing.
  • If a record exists but is expired, returns process.
  • If status is complete or error, returns the corresponding cache status.

Notes

  • If you set deleteDataTableOnExpired, records in the data table will be deleted when the cache expires.

  • If overwriteExistingCache === true, the function behaves as if the cache is expired and will overwrite the existing cache.

  • format of data tables to delete on expired

 [
    {
      tableName: 'TableData',
      partitionKeyFieldName: 'cacheId',
      sortKeyFieldName: 'sortCacheId',
      dataPartitionKeyTemplate: "[cacheId]",
    }
]

2. Complete Stored Cache

Sets the status of a cache record to complete if it is not already complete or error.

await storedCacheSharedLib.completeStoredCache(
  _izContext,
  "cacheMain",
  { idKey: "001002003" }, // Key values
  "complete",             // Status
  {},                     // Additional attributes
  "testStoredCache",      // Prefix
  null,                   // Expiry interval
  Date.now(),             // Time cache completed
  []                      // Errors found
);

3. Complete Stored Cache and Delete Related Data

Completes the cache record and deletes related data tables if uniqueRequestId does not match.

await storedCacheSharedLib.completeStoredCache(
  _izContext,
  "cacheMain",
  { idKey: "001002003" }, // Key values
  "complete",             // Status
  {
    settings: {
      deleteDataTable:  [ // deleteDataTable
      {
        tableName: 'TableData',
        partitionKeyFieldName: 'cacheId',
        sortKeyFieldName: 'sortCacheId',
        dataPartitionKeyTemplate: "[cacheId]",
        uniqueRequestIdFieldName: "xx", // optional, need to add this when complete storedCache and need to check uniqueRequestId
      }
    ],
      uniqueRequestId: uniqueRequestId
    }
  },
  "testStoredCache",      // Prefix
  null,                   // Expiry interval
  Date.now(),             // Time cache completed
  []                      // Errors found
);

Behavior:

  • If uniqueRequestId does not match, the function checks the main cache record and deletes data records with the same partition key but different uniqueRequestId.
  • should set deleteDataTable and uniqueRequestId

Behavior: