Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@file-cache/core

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@file-cache/core - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

2

package.json
{
"name": "@file-cache/core",
"version": "0.0.1",
"version": "0.0.2",
"description": "A cache for file metadata or file content.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -22,4 +22,6 @@ import fs from "node:fs/promises";

export const createFileCache = async (cacheFilePath: string, mode: "content" | "metadata") => {
// When mode is changed, create another cache
const cacheFileFullPath = cacheFilePath + mode;
// file <-> Map
let fileCacheMap = await readFileCache(cacheFilePath + mode);
let fileCacheMap = await readFileCache(cacheFileFullPath);
// Processing Map

@@ -90,3 +92,3 @@ const entryMap = new Map<string, CacheValue>(fileCacheMap);

try {
await fs.writeFile(cacheFilePath, JSON.stringify(Object.fromEntries(entryMap)), "utf-8");
await fs.writeFile(cacheFileFullPath, JSON.stringify(Object.fromEntries(entryMap)), "utf-8");
// reflect the changes in the cacheMap

@@ -93,0 +95,0 @@ fileCacheMap = new Map(entryMap);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc