{"id":19307368,"url":"https://github.com/bonnevoyager/quick-storage","last_synced_at":"2026-04-16T19:36:11.171Z","repository":{"id":39499232,"uuid":"137847205","full_name":"BonneVoyager/quick-storage","owner":"BonneVoyager","description":"Simple key/value storage module with persistency.","archived":false,"fork":false,"pushed_at":"2023-07-18T21:33:10.000Z","size":291,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-01T03:42:37.981Z","etag":null,"topics":["browser","data","fs","indexeddb","javascript","key-value","nodejs","persistence","quick","server","storage"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BonneVoyager.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-19T06:06:20.000Z","updated_at":"2022-02-13T09:04:26.000Z","dependencies_parsed_at":"2024-11-10T00:10:56.267Z","dependency_job_id":"3d4689d8-7d17-4222-aff1-2cf7e98aedb1","html_url":"https://github.com/BonneVoyager/quick-storage","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BonneVoyager%2Fquick-storage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BonneVoyager%2Fquick-storage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BonneVoyager%2Fquick-storage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BonneVoyager%2Fquick-storage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BonneVoyager","download_url":"https://codeload.github.com/BonneVoyager/quick-storage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240409256,"owners_count":19796789,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser","data","fs","indexeddb","javascript","key-value","nodejs","persistence","quick","server","storage"],"created_at":"2024-11-10T00:10:40.265Z","updated_at":"2025-10-30T03:52:22.917Z","avatar_url":"https://github.com/BonneVoyager.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QuickStorage\n\nSimple key/value storage module with persistency on file system.\n\nThis module used to work in the browser with IndexedDB, more info can be found here https://github.com/BonneVoyager/quick-storage/tree/v1.4.0.\n\n## Installation\n\n```\nnpm install --save quick-storage\n```\n\n## Usage\n\n`QuickStorage` expects an argument - a path to store data in the file system (otherwise, it will throw).\n\n```ts\nimport QuickStorage from 'quick-storage'\nconst myStorage = new QuickStorage(`${__dirname}/data`)\n```\n\nThis will create `${__dirname}/data` directory and store data in it. Each data key will be stored in separate file (key `myKey` will be store in file `${__dirname}/data/myKey`). File content is stringified on write, and parsed on read.\n\n## API\n\n```js\nmyStorage.set('myKey', { foo: 'bar' })\n```\n\n```js\nmyStorage.has('myKey') // true\n```\n\n```js\nmyStorage.get('myKey') // { \"foo\": \"bar\" }\n```\n\n```js\nmyStorage.keys() // [ \"foo\" ]\n```\n\n```js\nmyStorage.delete('myKey')\n```\n\n```js\nmyStorage.isReady // false before onReady callback, and true afterwards\n```\n\n```js\nmyStorage.onReady((fn) =\u003e {\n  console.info('All previous data was read and I am ready for some work!')\n})\n```\n\n```js\nmyStorage.onError((err) =\u003e {\n  console.error('My storage error:', err)\n})\n```\n\n```js\nconst obj = { foo: \"bar\" }\nmyStorage.proxy(obj, {\n  preventExtensions: true, // whether to invoke Object.preventExtensions(obj)\n  persistProps: [ 'foo' ]  // props which should keep the persistency\n})\n```\n\n## Few tips\n\n- please keep in mind that this module is intended to be used with small chunks of data (up to dozens of megabytes). All the data is stored in memory with `Map` cache object.\n- data is parsed between string and json. That means that this module works only with JSON objects.\n- when you create `QuickStorage(__dirname + '/data')`, the script will try to find and read data associated with `__dirname + '/data'` (read FS on the server). After it's read, storage object will call `onReady` function.\n- you can use a callback as a second argument for `get` function to force read the data from the FS, instead of `Map` cache object.\n\n## Test\n\n```\nnpm run test\n```\n\n## Changelog\n\n[CHANGELOG.md](https://github.com/BonneVoyager/quick-storage/blob/master/CHANGELOG.md)\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbonnevoyager%2Fquick-storage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbonnevoyager%2Fquick-storage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbonnevoyager%2Fquick-storage/lists"}