cachedir
Advanced tools
Comparing version 2.0.0 to 2.1.0
const os = require('os') | ||
const path = require('path') | ||
const homedir = require('os-homedir') | ||
function posix (id) { | ||
const cacheHome = process.env.XDG_CACHE_HOME || path.join(homedir(), '.cache') | ||
const cacheHome = process.env.XDG_CACHE_HOME || path.join(os.homedir(), '.cache') | ||
return path.join(cacheHome, id) | ||
@@ -11,7 +10,7 @@ } | ||
function darwin (id) { | ||
return path.join(homedir(), 'Library', 'Caches', id) | ||
return path.join(os.homedir(), 'Library', 'Caches', id) | ||
} | ||
function win32 (id) { | ||
const appData = process.env.LOCALAPPDATA || path.join(homedir(), 'AppData', 'Local') | ||
const appData = process.env.LOCALAPPDATA || path.join(os.homedir(), 'AppData', 'Local') | ||
return path.join(appData, id, 'Cache') | ||
@@ -18,0 +17,0 @@ } |
{ | ||
"name": "cachedir", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"license": "MIT", | ||
@@ -10,5 +10,3 @@ "repository": "LinusU/node-cachedir", | ||
}, | ||
"dependencies": { | ||
"os-homedir": "^1.0.1" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
@@ -15,0 +13,0 @@ "mocha": "^5.2.0", |
10
test.js
/* eslint-env mocha */ | ||
const assert = require('assert') | ||
const homedir = require('os-homedir') | ||
const os = require('os') | ||
const proxyquire = require('proxyquire') | ||
const platforms = [ | ||
['darwin', `${homedir()}/Library/Caches/linusu`], | ||
['freebsd', `${homedir()}/.cache/linusu`], | ||
['linux', `${homedir()}/.cache/linusu`], | ||
['win32', `${homedir()}/AppData/Local/linusu/Cache`] | ||
['darwin', `${os.homedir()}/Library/Caches/linusu`], | ||
['freebsd', `${os.homedir()}/.cache/linusu`], | ||
['linux', `${os.homedir()}/.cache/linusu`], | ||
['win32', `${os.homedir()}/AppData/Local/linusu/Cache`] | ||
] | ||
@@ -13,0 +13,0 @@ |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
0
4730
83
8
- Removedos-homedir@^1.0.1
- Removedos-homedir@1.0.2(transitive)