Socket
Socket
Sign inDemoInstall

@ms-cloudpack/config

Package Overview
Dependencies
Maintainers
0
Versions
155
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ms-cloudpack/config - npm Package Compare versions

Comparing version 0.27.2 to 0.28.0

10

lib/getCachePath.d.ts
/**
* Gets the path to the cache directory.
* Get the cache path from user preferences if set.
* Falls back to the default cache path `~/.cloudpack`.
*
* NOTE: If a session object is available, you should use `session.cachePath` instead.
*
* @param overridePath If set, this path (probably from a CLI option) will be used instead
* of the path from preferences.
*/
export declare function getCachePath(): string;
export declare function getCachePath(overridePath?: string): Promise<string>;
/**

@@ -6,0 +12,0 @@ * Gets the path to the app's local cache directory.

13

lib/getCachePath.js
import os from 'os';
import path from 'path';
import { readUserPreferences } from './readUserPreferences.js';
/**
* Gets the path to the cache directory.
* Get the cache path from user preferences if set.
* Falls back to the default cache path `~/.cloudpack`.
*
* NOTE: If a session object is available, you should use `session.cachePath` instead.
*
* @param overridePath If set, this path (probably from a CLI option) will be used instead
* of the path from preferences.
*/
export function getCachePath() {
return path.join(os.homedir(), '.cloudpack');
export async function getCachePath(overridePath) {
return overridePath || (await readUserPreferences())?.cachePath || path.join(os.homedir(), '.cloudpack');
}

@@ -9,0 +16,0 @@ /**

{
"name": "@ms-cloudpack/config",
"version": "0.27.2",
"version": "0.28.0",
"description": "Configuration handling for cloudpack.",

@@ -5,0 +5,0 @@ "license": "MIT",

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