Skip to content

Commit d06613f

Browse files
committed
feat: use home .cache dir, closes #4
1 parent 0c7a0be commit d06613f

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

lib/constants.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
const os = require('os')
2-
const path = require('path')
1+
const envPaths = require('env-paths')
32

4-
exports.CACHE_DIR = path.join(os.homedir(), '.import-http')
3+
exports.CACHE_DIR = envPaths('import-http', { suffix: '' }).cache

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"license": "MIT",
2121
"dependencies": {
2222
"builtin-modules": "^3.0.0",
23+
"env-paths": "^2.0.0",
2324
"mkdirp": "^0.5.1",
2425
"node-fetch": "^2.3.0"
2526
},

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2173,6 +2173,11 @@ env-editor@^0.3.1:
21732173
resolved "https://registry.npmjs.org/env-editor/-/env-editor-0.3.1.tgz#30d0540c2101414f258a94d4c0a524c06c13e3c6"
21742174
integrity sha1-MNBUDCEBQU8lipTUwKUkwGwT48Y=
21752175

2176+
env-paths@^2.0.0:
2177+
version "2.0.0"
2178+
resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.0.0.tgz#5a71723f3df7ca98113541f6fa972184f2c9611d"
2179+
integrity sha512-13VpSqOO91W3MskXxWJ8x+Y33RKaPT53/HviPp8QcMmEbAJaPFEm8BmMpxCHroJ5rGADqr34Zl6zosBt3F+xAA==
2180+
21762181
err-code@^1.0.0:
21772182
version "1.1.2"
21782183
resolved "https://registry.npmjs.org/err-code/-/err-code-1.1.2.tgz#06e0116d3028f6aef4806849eb0ea6a748ae6960"

0 commit comments

Comments
 (0)