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

memo-json

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

memo-json - npm Package Compare versions

Comparing version 0.1.3 to 0.2.0

15

lib/index.js

@@ -42,5 +42,5 @@ "use strict";

const cacheFullPath = (0, path_1.join)(cacheDir, `${fnName}-${argsHash}.json`);
if ((0, fs_1.existsSync)(cacheFullPath)) {
if (await exists(cacheFullPath)) {
(0, logger_1.debug)("Hit the cache %s", (0, path_1.relative)(cwd, cacheFullPath));
const content = (0, fs_1.readFileSync)(cacheFullPath, "utf-8");
const content = await (0, promises_1.readFile)(cacheFullPath, "utf-8");
return JSON.parse(content);

@@ -50,3 +50,3 @@ }

const serialized = JSON.stringify(result);
(0, fs_1.writeFileSync)(cacheFullPath, serialized);
await (0, promises_1.writeFile)(cacheFullPath, serialized);
(0, logger_1.debug)("Cached %s", (0, path_1.relative)(cwd, cacheFullPath));

@@ -58,2 +58,11 @@ return result;

}
async function exists(path) {
try {
await (0, promises_1.access)(path, fs_1.constants.F_OK);
}
catch (e) {
return false;
}
return true;
}
async function clearCache({ dir = defaultDir, enable = true } = {}) {

@@ -60,0 +69,0 @@ const cacheDir = (0, path_1.join)(cwd, dir);

22

package.json
{
"name": "memo-json",
"version": "0.1.3",
"version": "0.2.0",
"description": "",

@@ -14,17 +14,17 @@ "homepage": "https://github.com/piglovesyou/memo-json",

"devDependencies": {
"@babel/plugin-proposal-decorators": "7.15.8",
"@babel/preset-env": "7.15.8",
"@babel/preset-typescript": "7.15.0",
"@babel/plugin-proposal-decorators": "7.17.2",
"@babel/preset-env": "7.16.11",
"@babel/preset-typescript": "7.16.7",
"@types/debug": "4.1.7",
"@types/jest": "27.0.2",
"@types/node": "16.10.3",
"husky": "7.0.2",
"jest": "27.2.4",
"@types/jest": "27.4.0",
"@types/node": "16.11.24",
"husky": "7.0.4",
"jest": "27.4.5",
"prettier": "2.4.1",
"prettier-plugin-organize-imports": "2.3.4",
"pretty-quick": "3.1.1",
"typescript": "4.4.3"
"pretty-quick": "3.1.3",
"typescript": "4.5.5"
},
"dependencies": {
"debug": "4.3.2",
"debug": "4.3.3",
"make-dir": "2.1.0"

@@ -31,0 +31,0 @@ },

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