{"_id":"@amitosdev/s3-store-mock","_rev":"4-1e51bcf5f0cc7f64ca26c153d17616e0","name":"@amitosdev/s3-store-mock","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.1":{"name":"@amitosdev/s3-store-mock","version":"1.0.1","author":{"name":"Amit Tal"},"license":"Apache-2.0","_id":"@amitosdev/s3-store-mock@1.0.1","maintainers":[{"name":"amitosdev","email":"amitosdev@gmail.com"}],"homepage":"https://github.com/amitosdev/s3-store-mock#readme","bugs":{"url":"https://github.com/amitosdev/s3-store-mock/issues"},"dist":{"shasum":"5d9d9bbe8e81e184865f3f740e21c5509cac0b9d","tarball":"https://registry.npmjs.org/@amitosdev/s3-store-mock/-/s3-store-mock-1.0.1.tgz","fileCount":7,"integrity":"sha512-gqOtOIrITkDEHlb3UQVLKS8Lu44R8JIJVJHu3Q7PARZqQTjfxzHPQgNaxFBOyIwYnSUZss8byAAwvLGXuQt4Tg==","signatures":[{"sig":"MEUCICG3mR6OXpEQ9zYuzcJpZG/Pc58MHvj8fmghnGRRw1O+AiEAsCNdV1RonJ1s8MV7vzMjSwzrbkunalBkLWH3JtkrKCc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28280},"main":"index.mjs","type":"module","gitHead":"f363b51371ae866471dde91e11852af94291d68f","scripts":{"test":"ava"},"_npmUser":{"name":"amitosdev","email":"amitosdev@gmail.com"},"repository":{"url":"git+https://github.com/amitosdev/s3-store-mock.git","type":"git"},"_npmVersion":"11.6.2","description":"Mock implementation of @kessler/s3-store using local file system","directories":{},"_nodeVersion":"22.20.0","dependencies":{"@kessler/s3-store":"^3.2.1"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^6.4.1","@biomejs/biome":"^2.2.6"},"_npmOperationalInternal":{"tmp":"tmp/s3-store-mock_1.0.1_1760599959591_0.5379358043890967","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@amitosdev/s3-store-mock","version":"1.0.2","author":{"name":"Amit Tal"},"license":"Apache-2.0","_id":"@amitosdev/s3-store-mock@1.0.2","maintainers":[{"name":"amitosdev","email":"amitosdev@gmail.com"}],"homepage":"https://github.com/amitosdev/s3-store-mock#readme","bugs":{"url":"https://github.com/amitosdev/s3-store-mock/issues"},"dist":{"shasum":"845a068eb5b977420f0667ae7804b30c1e6506c0","tarball":"https://registry.npmjs.org/@amitosdev/s3-store-mock/-/s3-store-mock-1.0.2.tgz","fileCount":7,"integrity":"sha512-JhOpudninXGf3y2z3lh1BKwmKP3fCe96e0BQvnqlQEGOwvjkGtmo9KimGFepOTuGJ2yssp95vhW1PR7azTbivA==","signatures":[{"sig":"MEUCIQDLrcfSM6FZGa9auGHqY0s35MWy9/wK59B/4/cAJsO6cwIgBZwg2aYbaU1Fcn4p5sYUFitopU74Q568dw5px3WLLzY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28249},"main":"index.mjs","type":"module","gitHead":"1ccec060ecad7bd34f4670652b202a0564d550ec","scripts":{"test":"ava"},"_npmUser":{"name":"amitosdev","email":"amitosdev@gmail.com"},"repository":{"url":"git+https://github.com/amitosdev/s3-store-mock.git","type":"git"},"_npmVersion":"11.6.2","description":"Mock implementation of @kessler/s3-store using local file system","directories":{},"_nodeVersion":"22.20.0","dependencies":{"@kessler/s3-store":"^3.2.1"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^6.4.1","@biomejs/biome":"^2.2.6"},"_npmOperationalInternal":{"tmp":"tmp/s3-store-mock_1.0.2_1760600925059_0.4250225674143808","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@amitosdev/s3-store-mock","version":"1.1.0","author":{"name":"Amit Tal"},"license":"Apache-2.0","_id":"@amitosdev/s3-store-mock@1.1.0","maintainers":[{"name":"amitosdev","email":"amitosdev@gmail.com"}],"homepage":"https://github.com/amitosdev/s3-store-mock#readme","bugs":{"url":"https://github.com/amitosdev/s3-store-mock/issues"},"dist":{"shasum":"2009bec635c19eec685fa2d80d04902420a2c0f5","tarball":"https://registry.npmjs.org/@amitosdev/s3-store-mock/-/s3-store-mock-1.1.0.tgz","fileCount":8,"integrity":"sha512-kGi2UHC9EpIpcyM/DRZTDsNSf+1vmhbZ4ssbc+0Y+U4CXkOlWOWUA2kMT98D2SvoDT67BXZ5OhwrpDuxLh200g==","signatures":[{"sig":"MEYCIQDJKpGuEDXNG7/hnjxnmbkh9mB6MqFdPiNS5F9/af+bPwIhAOyEqsQq8lh8yUddE3C1654EW7he/ufjpwCwf3ttz0Ex","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32850},"main":"index.mjs","type":"module","types":"index.d.ts","gitHead":"707b22d272c78f70e77f70bb455af27b5029d1d6","scripts":{"test":"ava"},"_npmUser":{"name":"amitosdev","email":"amitosdev@gmail.com"},"repository":{"url":"git+https://github.com/amitosdev/s3-store-mock.git","type":"git"},"_npmVersion":"11.6.2","description":"Mock implementation of @kessler/s3-store using local file system","directories":{},"_nodeVersion":"22.20.0","dependencies":{"@kessler/s3-store":"^3.2.1"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^6.4.1","@biomejs/biome":"^2.2.6"},"_npmOperationalInternal":{"tmp":"tmp/s3-store-mock_1.1.0_1760603003916_0.22431933088712674","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@amitosdev/s3-store-mock","version":"2.0.0","description":"Mock implementation of @kessler/s3-store using local file system","author":{"name":"Amit Tal"},"license":"Apache-2.0","type":"module","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/amitosdev/s3-store-mock.git"},"main":"index.mjs","scripts":{"test":"ava"},"dependencies":{"@kessler/s3-store":"^3.2.1"},"devDependencies":{"@biomejs/biome":"^2.2.6","ava":"^6.4.1"},"gitHead":"3f0c841bea76def7f48e1a7d8f2888420f253c53","_id":"@amitosdev/s3-store-mock@2.0.0","bugs":{"url":"https://github.com/amitosdev/s3-store-mock/issues"},"homepage":"https://github.com/amitosdev/s3-store-mock#readme","_nodeVersion":"24.11.0","_npmVersion":"11.6.1","dist":{"integrity":"sha512-lI6Oj2F28C3yfizpmGBW++nc5/i5gXlIJm9iSawn7rsDymAolgCi6cnNXw+UYHGf1hY8gMke+e24pZuZmdxazg==","shasum":"9d5bcdba78f64d3dbd42a5923972371b3144c7be","tarball":"https://registry.npmjs.org/@amitosdev/s3-store-mock/-/s3-store-mock-2.0.0.tgz","fileCount":8,"unpackedSize":38704,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCJQuo8roFVEzn4Z7E+efusVoAypolHDEwjppe5/KvF1AIhAL2VOFoINGARJnR7KFoHAceqR5pXYQ/C4J9TiICQOiWD"}]},"_npmUser":{"name":"amitosdev","email":"amitosdev@gmail.com"},"directories":{},"maintainers":[{"name":"amitosdev","email":"amitosdev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/s3-store-mock_2.0.0_1763883755706_0.377892127272623"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-16T07:32:39.466Z","modified":"2025-11-23T07:42:36.085Z","1.0.1":"2025-10-16T07:32:39.752Z","1.0.2":"2025-10-16T07:48:45.285Z","1.1.0":"2025-10-16T08:23:24.127Z","2.0.0":"2025-11-23T07:42:35.910Z"},"bugs":{"url":"https://github.com/amitosdev/s3-store-mock/issues"},"author":{"name":"Amit Tal"},"license":"Apache-2.0","homepage":"https://github.com/amitosdev/s3-store-mock#readme","repository":{"type":"git","url":"git+https://github.com/amitosdev/s3-store-mock.git"},"description":"Mock implementation of @kessler/s3-store using local file system","maintainers":[{"name":"amitosdev","email":"amitosdev@gmail.com"}],"readme":"# @amitosdev/s3-store-mock\n\nA mock implementation of [@kessler/s3-store](https://github.com/kessler/s3-store) that uses the local file system instead of AWS S3.\n\n## About\n\nThis package provides a drop-in replacement for `@kessler/s3-store` that stores data in local files instead of S3. Perfect for testing, local development, or offline work.\n\n## Installation\n\n```bash\nnpm install @amitosdev/s3-store-mock @kessler/s3-store\n```\n\nNote: `@kessler/s3-store` is required as a peer dependency for the JSON wrapper functionality.\n\n## Usage\n\n```javascript\nimport createS3Store from '@amitosdev/s3-store-mock'\nimport { createJsonWrapper } from '@kessler/s3-store'\n\n// Create a store (stores files in .s3StoreMock/my-bucket/ by default)\nconst store = createS3Store('my-bucket')\n\n// Specify a custom directory name\nconst store = createS3Store('my-bucket', { mockDir: './my-custom-mock-dir' })\n\n// Specify a custom base path (defaults to process.cwd())\nconst store = createS3Store('my-bucket', { basePath: '/custom/path' })\n\n// Combine both options\nconst store = createS3Store('my-bucket', {\n  mockDir: './my-custom-mock-dir',\n  basePath: '/custom/path'\n})\n\n// Use the JSON wrapper for automatic JSON serialization\nconst jsonStore = createJsonWrapper(store)\n\n// Create an object\nconst etag = await jsonStore.createObject('my-key', { hello: 'world' })\n\n// Get an object\nconst [data, etag] = await jsonStore.getObject('my-key')\nconsole.log(data) // { hello: 'world' }\n\n// Update with etag\nconst newEtag = await jsonStore.putObjectIfMatch('my-key', { hello: 'universe' }, etag)\n\n// Delete an object\nawait store.deleteObject('my-key')\n\n// List objects\nfor await (const objects of store.list('prefix/')) {\n  console.log(objects)\n}\n```\n\n## API\n\nThis mock implements the same API as [@kessler/s3-store](https://github.com/kessler/s3-store):\n\n- `createObject(key, body, contentType)` - Create a new object (fails if key exists)\n- `putObjectIfMatch(key, body, etag, contentType)` - Update object with etag validation\n- `getObject(key)` - Get object without etag check\n- `getObjectIfMatch(key, etag)` - Get object with etag validation\n- `deleteObject(key)` - Delete object\n- `deleteObjectIfMatch(key, etag)` - Delete object with etag validation\n- `list(prefix)` - Async iterator for listing objects\n\n## Testing\n\n```bash\nnpm test\n```\n\n## Configuration Options\n\n- **`mockDir`** (default: `.s3StoreMock`) - The directory name where mock data is stored\n- **`basePath`** (default: `process.cwd()`) - The base path where the mockDir will be created\n\n## How It Works\n\n- Files are stored in `{basePath}/{mockDir}/{bucket}/{key}` (defaults to `.s3StoreMock/{bucket}/{key}` in current directory)\n- ETags are calculated using MD5 hashes and wrapped in double quotes (e.g., `\"6805f2cfc46c0f04559748bb039d69ae\"`)\n- Metadata (ETags, content type) is stored in `.meta` files alongside the data files\n- All the same errors are thrown (`KeyExistsError`, `StaleDataError`, etc.)\n- List results match AWS S3 format with all properties: `Key`, `LastModified`, `ETag`, `Size`, `StorageClass`, and `Owner`\n- Error handling follows AWS SDK patterns - only expected errors (e.g., `ENOENT`) are caught, unexpected errors (permissions, corruption, etc.) are properly thrown\n\n## Original Module\n\nThis is a mock implementation of [@kessler/s3-store](https://github.com/kessler/s3-store). For production use with real AWS S3, please use the original module.\n\n## License\n\nApache-2.0\n","readmeFilename":"README.md"}