diff --git a/package.json b/package.json index e679712..7fad0fb 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "node-fetch-cache", "version": "2.0.3", "description": "node-fetch with a persistent cache.", - "main": "index.js", + "main": "src/index.js", "type": "module", "scripts": { "test": "mocha --timeout 10000 --exit", diff --git a/classes/caching/file_system_cache.js b/src/classes/caching/file_system_cache.js similarity index 100% rename from classes/caching/file_system_cache.js rename to src/classes/caching/file_system_cache.js diff --git a/classes/caching/key_timeout.js b/src/classes/caching/key_timeout.js similarity index 100% rename from classes/caching/key_timeout.js rename to src/classes/caching/key_timeout.js diff --git a/classes/caching/memory_cache.js b/src/classes/caching/memory_cache.js similarity index 100% rename from classes/caching/memory_cache.js rename to src/classes/caching/memory_cache.js diff --git a/classes/headers.js b/src/classes/headers.js similarity index 100% rename from classes/headers.js rename to src/classes/headers.js diff --git a/classes/response.js b/src/classes/response.js similarity index 100% rename from classes/response.js rename to src/classes/response.js diff --git a/index.js b/src/index.js similarity index 100% rename from index.js rename to src/index.js diff --git a/test/tests.js b/test/tests.js index 9293ad5..747d7b1 100644 --- a/test/tests.js +++ b/test/tests.js @@ -7,7 +7,7 @@ import rimraf from 'rimraf'; import path from 'path'; import { URLSearchParams } from 'url'; import standardFetch from 'node-fetch'; -import FetchCache, { MemoryCache, FileSystemCache } from '../index.js'; +import FetchCache, { MemoryCache, FileSystemCache } from '../src/index.js'; import { Agent } from 'http'; const __dirname = dirname(fileURLToPath(import.meta.url)); @@ -260,7 +260,7 @@ describe('Cache tests', function() { it('Gives different read streams different cache keys', async function() { const s1 = fs.createReadStream(path.join(__dirname, 'expected_png.png')); - const s2 = fs.createReadStream(path.join(__dirname, '..', 'index.js')); + const s2 = fs.createReadStream(path.join(__dirname, '..', 'src', 'index.js')); res = await cachedFetch(TWO_HUNDRED_URL, post(s1)); assert.strictEqual(res.fromCache, false);