{"id":17335206,"url":"https://github.com/bugdiver/taiko-storage","last_synced_at":"2025-07-20T02:32:03.466Z","repository":{"id":35107047,"uuid":"207331312","full_name":"BugDiver/taiko-storage","owner":"BugDiver","description":"A taiko plugin to interact with browser storages","archived":false,"fork":false,"pushed_at":"2023-01-04T09:34:43.000Z","size":1448,"stargazers_count":7,"open_issues_count":12,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-05T16:22:47.840Z","etag":null,"topics":["chrome","localstorage","plugin","sessionstorage","taiko"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/BugDiver.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":"2019-09-09T14:39:25.000Z","updated_at":"2022-10-09T11:59:03.000Z","dependencies_parsed_at":"2023-01-15T13:57:39.268Z","dependency_job_id":null,"html_url":"https://github.com/BugDiver/taiko-storage","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/BugDiver/taiko-storage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BugDiver%2Ftaiko-storage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BugDiver%2Ftaiko-storage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BugDiver%2Ftaiko-storage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BugDiver%2Ftaiko-storage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BugDiver","download_url":"https://codeload.github.com/BugDiver/taiko-storage/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BugDiver%2Ftaiko-storage/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266058469,"owners_count":23870155,"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":["chrome","localstorage","plugin","sessionstorage","taiko"],"created_at":"2024-10-15T15:08:30.965Z","updated_at":"2025-07-20T02:32:03.404Z","avatar_url":"https://github.com/BugDiver.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n\t\u003cimg src=\"./assets/taiko-storage.png\" alt=\"Taiko Storage\"\u003e\n\t\u003cbr\u003e\n\u003c/h1\u003e\n\n[![npm version](https://badge.fury.io/js/taiko-storage.svg)](https://badge.fury.io/js/taiko-storage)\n[![Actions Status](https://github.com/bugdiver/taiko-storage/workflows/tests/badge.svg)](https://github.com/BugDiver/taiko-storage/actions)\n\n# taiko-storage\n\nA taiko plugin to interact with browser storages (localStorage and sessionStorage).\n\n## Installation\n\n- `npm install taiko-storage --save`\n\n## Usage\n\n```javascript\nconst { openBrowser, closeBrowser, click, storage: { localStorage, sessionStorage} } = require('taiko');\n\n/*\nOR\n\nconst { openBrowser, closeBrowser, click, storage } = require('taiko');\nconst {localStorage, sessionStorage} = storage;\n\n*/\n\n(async () =\u003e {\n    try {\n        await openBrowser();\n        await localStorage.setItem(\"Key\", \"Value\");\n        let value = await localStorage.getItem(\"Key\");\n        // more actions\n        // ...\n    } finally {\n        await closeBrowser();\n    }\n})();\n```\n\n## APIs\n\nThe plugin exposes two variables `localStorage` and `sessionStorage` which represents to the respective storages.\nThe APIs for both the storage are same and try to very close the the native storage apis.\n\n### `setItem(key, value)`\n\nset the given key value to storage\n\n```js\nawait localStorage.setItem(key, value);\n// or\nawait sessionStorage.setItem(key, value);\n\n```\n\n### `getItem(key)`\n\nfeatch the value for given key from storage\n\n```js\nawait localStorage.getItem(key);\n// or\nawait sessionStorage.getItem(key);\n\n```\n\n\n### `hasItem(key)`\n\nvalidate if the given key exists in storage.\n\n```js\nawait localStorage.hasItem(key);\n// or\nawait sessionStorage.hasItem(key);\n\n```\n\n\n### `removeItem(key)`\n\nremove the item with given key from the storage.\n\n```js\nawait localStorage.removeItem(key);\n// or\nawait sessionStorage.removeItem(key);\n\n```\n\n\n### `clear()`\n\nclear the stoarage\n\n```js\nawait localStorage.clear();\n// or\nawait sessionStorage.clear();\n\n```\n\n### `length()`\n\ntell the no of items in storage.\n\n```js\nawait localStorage.length();\n// or\nawait sessionStorage.length();\n\n```\n\n\n## Passing Taiko options to APIS,\n\n* The API's allows to pass a optional argument `options` which will be passed to taiko's `evaluate` API (used internally in storage APIs)\n\nExample:\n\n```js\n\nawait localStorage.setItem(key, value, { waitForNavigation: false });\n\n```\n\n## Use in Taiko REPL\n\nTo launch the REPL type `taiko --plugin taiko-storage` in your favorite terminal application. This will launch the Taiko Prompt.\n\ne.g\n`Version: 0.7.0 (Chromium:74.0.3723.0) Type .api for help and .exit to quit`\n\nYou should now have full access to localStorage and sessionStorage apis in the taiko REPL window\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugdiver%2Ftaiko-storage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbugdiver%2Ftaiko-storage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugdiver%2Ftaiko-storage/lists"}