{"id":13506636,"url":"https://github.com/mazipan/nuxt-storage","last_synced_at":"2025-03-30T05:31:15.555Z","repository":{"id":49188121,"uuid":"150287425","full_name":"mazipan/nuxt-storage","owner":"mazipan","description":"🛢 Utilities for easy read and write browser's storage in Nuxt.js project","archived":true,"fork":false,"pushed_at":"2021-06-24T11:49:58.000Z","size":1366,"stargazers_count":128,"open_issues_count":6,"forks_count":8,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T10:49:17.233Z","etag":null,"topics":["browser-storage","localstorage","nuxt","nuxt-storage","sessionstorage"],"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/mazipan.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":"2018-09-25T15:23:30.000Z","updated_at":"2025-02-28T03:27:43.000Z","dependencies_parsed_at":"2022-09-16T20:20:33.466Z","dependency_job_id":null,"html_url":"https://github.com/mazipan/nuxt-storage","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mazipan%2Fnuxt-storage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mazipan%2Fnuxt-storage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mazipan%2Fnuxt-storage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mazipan%2Fnuxt-storage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mazipan","download_url":"https://codeload.github.com/mazipan/nuxt-storage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246281099,"owners_count":20752203,"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-storage","localstorage","nuxt","nuxt-storage","sessionstorage"],"created_at":"2024-08-01T01:00:54.868Z","updated_at":"2025-03-30T05:31:15.272Z","avatar_url":"https://github.com/mazipan.png","language":"TypeScript","funding_links":["https://www.buymeacoffee.com/mazipan?utm_source=github","https://www.paypal.me/mazipan?utm_source=github","https://ko-fi.com/mazipan"],"categories":["Uncategorized","TypeScript","Open Source Project"],"sub_categories":["Uncategorized","Utility"],"readme":"# 🛢 Nuxt-Storage\n[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg)](#contributors)\n![](https://badgen.net/bundlephobia/minzip/nuxt-storage)\n[![version](https://img.shields.io/npm/v/nuxt-storage.svg?maxAge=3600)](https://www.npmjs.com/package/nuxt-storage)\n[![downloads](https://img.shields.io/npm/dt/nuxt-storage.svg?maxAge=86400)](https://www.npmjs.com/package/nuxt-storage) [![Travis](https://img.shields.io/travis/mazipan/nuxt-storage.svg?maxAge=86400)](https://travis-ci.org/mazipan/nuxt-storage)\n[![codecov](https://codecov.io/gh/mazipan/nuxt-storage/branch/master/graph/badge.svg?maxAge=86400)](https://codecov.io/gh/mazipan/nuxt-storage) ![Dependencies](https://img.shields.io/david/mazipan/nuxt-storage.svg)\n\n\u003e Utilities for easy read and write browser's storage in Nuxt.js project\n\n## Why I need this package?\n\nIn Nuxt, it's hard to play with browser's storage like `sessionStorage` and `localStorage`.\nThis package will help you handle client side storage with a simple API and with various useful additional features such as expiry.\n\n## How to install and use\n\nInstall using NPM or Yarn\n\n```bash\n# NPM\n$ npm i nuxt-storage\n\n# Yarn\n$ yarn add nuxt-storage\n```\n\n## Sample using this package\n\n##### Set data\n```js\nimport nuxtStorage from 'nuxt-storage';\n\nnuxtStorage.localStorage.setData('key', 'value');\nnuxtStorage.sessionStorage.setData('key', 'value');\n\n//Set data with expiry time\n\n// default time is 5 minutes, set it to 15\nnuxtStorage.localStorage.setData('key', 'value', 15);\n\n// default time unit is minutes , set it to hours, so type 'h'\nnuxtStorage.localStorage.setData('key', 'value', 1, 'h');\n```\n##### Get data by value\n```js\nnuxtStorage.localStorage.getData('key');\nnuxtStorage.sessionStorage.getData('key');\n```\n\n\n##### Remove or clear storage (localStorage/sessionStorage)\n\n```js\n// Remove single item by **key**\nnuxtStorage.localStorage.removeItem('key');\nnuxtStorage.sessionStorage.removeItem('key');\n\n// Clear entire storage\nnuxtStorage.localStorage.clear());\nnuxtStorage.sessionStorage.clear();\n```\n\n\n## API options\n\n| Method Name | Parameter                         | Default Value | Available Options |\n|-------------|-----------------------------------|---------------|-------------------|\n| getData     | `key` (type: String)              | Empty String  |  |\n| setData     | `key` (type: String)              | Empty String  |  |\n|             | `value` (type: any)               | Empty String  |  |\n|             | `expiry` (type: Number)           | 5             |  |\n|             | `expiryUnit` (type: String)       | m             | `s` = second, `m` = minutes, `h` = hour, `d` = day  |\n| removeItem  | `key` (type: String)              |               |  |\n| clear       | -                                 |               | | |\n\n\n## Support me\n\n- 👉 🇮🇩 [Trakteer](https://trakteer.id/mazipan?utm_source=github)\n- 👉 🌍 [BuyMeACoffe](https://www.buymeacoffee.com/mazipan?utm_source=github)\n- 👉 🌍 [Paypal](https://www.paypal.me/mazipan?utm_source=github)\n- 👉 🌍 [Ko-Fi](https://ko-fi.com/mazipan)\n\n-----\n\nCopyright © 2018 by Irfan Maulana\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://stainfilm.com\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/3953002?v=4\" width=\"100px;\" alt=\"notjiam\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003enotjiam\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/mazipan/nuxt-storage/commits?author=notjiam\" title=\"Tests\"\u003e⚠️\u003c/a\u003e \u003ca href=\"https://github.com/mazipan/nuxt-storage/issues?q=author%3Anotjiam\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://www.mazipan.xyz/\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/7221389?v=4\" width=\"100px;\" alt=\"Irfan Maulana\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eIrfan Maulana\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/mazipan/nuxt-storage/issues?q=author%3Amazipan\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"#maintenance-mazipan\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e \u003ca href=\"https://github.com/mazipan/nuxt-storage/commits?author=mazipan\" title=\"Tests\"\u003e⚠️\u003c/a\u003e \u003ca href=\"https://github.com/mazipan/nuxt-storage/commits?author=mazipan\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/devzom\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/1417473?v=4\" width=\"100px;\" alt=\"Jakub Zomerfeld\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJakub Zomerfeld\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e \u003ca href=\"#\" title=\"Documentation\"\u003e📝\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmazipan%2Fnuxt-storage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmazipan%2Fnuxt-storage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmazipan%2Fnuxt-storage/lists"}