{"id":30060291,"url":"https://github.com/tiaanduplessis/stoor","last_synced_at":"2025-08-08T01:43:39.054Z","repository":{"id":20924052,"uuid":"91273144","full_name":"tiaanduplessis/stoor","owner":"tiaanduplessis","description":"Storage wrapper with support for namespacing, timeouts and multi get/set and remove.","archived":false,"fork":false,"pushed_at":"2022-05-19T12:04:36.000Z","size":502,"stargazers_count":26,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-09T08:55:45.962Z","etag":null,"topics":["localstorage","sessionstorage","storage","wrapper"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tiaanduplessis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-14T21:40:37.000Z","updated_at":"2022-05-30T09:43:48.000Z","dependencies_parsed_at":"2022-08-25T21:40:30.408Z","dependency_job_id":null,"html_url":"https://github.com/tiaanduplessis/stoor","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/tiaanduplessis/stoor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fstoor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fstoor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fstoor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fstoor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiaanduplessis","download_url":"https://codeload.github.com/tiaanduplessis/stoor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fstoor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269352263,"owners_count":24402672,"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","status":"online","status_checked_at":"2025-08-07T02:00:09.698Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["localstorage","sessionstorage","storage","wrapper"],"created_at":"2025-08-08T01:43:33.316Z","updated_at":"2025-08-08T01:43:39.026Z","avatar_url":"https://github.com/tiaanduplessis.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# 📦 stoor\n[![package version](https://img.shields.io/npm/v/stoor.svg?style=flat-square)](https://npmjs.org/package/stoor)\n[![package downloads](https://img.shields.io/npm/dm/stoor.svg?style=flat-square)](https://npmjs.org/package/stoor)\n[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)\n[![package license](https://img.shields.io/npm/l/stoor.svg?style=flat-square)](https://npmjs.org/package/stoor)\n[![make a pull request](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n\nStorage wrapper with support for namespacing, timeouts and multi get/set and remove.\n\n## 👀 Background\n\nThis module is a small wrapper around the [local](https://developer.mozilla.org/en/docs/Web/API/Window/localStorage) and [session](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage) storage.\n\n### Features\n\n- Parsing and stringification of values\n- Custom storage adaptor\n- Plugable fallback (defaults to in memory)\n- Namespacing\n- Multi get, set \u0026 remove of values\n- Expiring values\n\n## Install\n\n## ⚙️ Install\n\nInstall the package locally within you project folder with your package manager:\n\nWith `npm`:\n```sh\nnpm install stoor\n```\n\nWith `yarn`:\n```sh\nyarn add stoor\n```\n\nWith `pnpm`:\n```sh\npnpm add stoor\n```\n\n## 📖 Usage\n\n### Kitchen sink\n\n```ts\n\nvar things = new Stoor({ namespace: 'things' }) // Namespaced to things and uses local storage\nvar otherThings = new Stoor({ namespace: 'otherThings', storage: 'session' }) // Namespaced to other things and uses Session storage\nthings.set('foo', 1)\nthings.set('bar', 2)\nthings.set('baz', { foo: 4, baz: 4 })\nconsole.log(things.get('baz')) // {foo: 4, baz: 4}\nconsole.log(otherThings.get('baz')) // null\nconsole.log(things.get(['foo', 'bar'])) // [1, 2]\n\nthings.remove(['foo', 'bar'])\nconsole.log(things.get(['foo', 'bar'])) // [null, null]\n\notherThings.set([['bar', 5], ['foo', 6]]) // Array of key value pairs to multi set\nconsole.log(otherThings.get(['foo', 'bar'])) // [6, 5]\n\notherThings.set('nana', 1, 5000) // Will expire within 5000 ms.\notherThings.get('nana', 3) // Returns default value if expired.\n\nthings.clear()\n```\n\n### Custom storage\n\nYou can configure any module that conforms to the the [localStorage](https://developer.mozilla.org/en/docs/Web/API/Window/localStorage)/[sessionStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage) API to be the fallback or main method of storage.\n\n\nFor example using [cookie-session-storage](https://github.com/tiaanduplessis/cookie-session-storage):\n\n```ts\nnew Stoor({fallback: cookieSessionStorage})\nnew Stoor({storage: cookieSessionStorage})\n```\n\n## 📚 API\n\nFor all configuration options, please see the [API docs](https://paka.dev/npm/stoor).\n\n## 💬 Contributing\n\nGot an idea for a new feature? Found a bug? Contributions are welcome! Please [open up an issue](https://github.com/tiaanduplessis/stoor/issues) or [make a pull request](https://makeapullrequest.com/).\n\n## 🪪 License\n\n[MIT © Tiaan du Plessis](./LICENSE)\n    ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiaanduplessis%2Fstoor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiaanduplessis%2Fstoor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiaanduplessis%2Fstoor/lists"}