{"id":19171246,"url":"https://github.com/alik0211/tiny-storage","last_synced_at":"2025-07-10T16:05:46.741Z","repository":{"id":57148413,"uuid":"145202638","full_name":"alik0211/tiny-storage","owner":"alik0211","description":"Tiny wrapper around localStorage and sessionStorage","archived":false,"fork":false,"pushed_at":"2020-09-17T14:34:44.000Z","size":13,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-21T15:18:26.566Z","etag":null,"topics":["localstorage","sessionstorage","storage","tiny-library"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/tiny-storage","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/alik0211.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-08-18T08:16:42.000Z","updated_at":"2023-05-30T12:31:31.000Z","dependencies_parsed_at":"2022-09-06T16:51:34.168Z","dependency_job_id":null,"html_url":"https://github.com/alik0211/tiny-storage","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/alik0211/tiny-storage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alik0211%2Ftiny-storage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alik0211%2Ftiny-storage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alik0211%2Ftiny-storage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alik0211%2Ftiny-storage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alik0211","download_url":"https://codeload.github.com/alik0211/tiny-storage/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alik0211%2Ftiny-storage/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264604720,"owners_count":23635925,"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":["localstorage","sessionstorage","storage","tiny-library"],"created_at":"2024-11-09T09:57:30.574Z","updated_at":"2025-07-10T16:05:46.723Z","avatar_url":"https://github.com/alik0211.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tiny-storage\n\n[![NPM](https://img.shields.io/npm/v/tiny-storage.svg?style=flat-square)](https://www.npmjs.com/package/tiny-storage)\n[![Travis](https://img.shields.io/travis/alik0211/tiny-storage/master.svg?style=flat-square)](https://travis-ci.com/alik0211/tiny-storage)\n[![Coverage Status](https://img.shields.io/coveralls/github/alik0211/tiny-storage/master.svg?style=flat-square)](https://coveralls.io/github/alik0211/tiny-storage?branch=master)\n\nTiny wrapper around localStorage and sessionStorage with reliable data storage.\n\n## Description\nThe `tinyLocalStorage` is the wrapper over the `localStorage`.\n\nThe `tinySessionStorage` is the wrapper over the `sessionStorage`.\n\n## Quick start\n### Module\n#### Installation\n```\nnpm install tiny-storage\n```\n#### Usage\n```javascript\nimport { tinyLocalStorage, tinySessionStorage } from 'tiny-storage';\n// Or as CommonJS\n// const { tinyLocalStorage, tinySessionStorage } = require('tiny-storage');\n\ntinyLocalStorage.set('user', {\n  name: 'Ali',\n  surname: 'Gasymov'\n});\n\ntinySessionStorage.set('user', {\n  name: 'Ali',\n  surname: 'Gasymov'\n});\n```\n\n### Browser\n#### Installation\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/tiny-storage@2.0.0/dist/tiny-storage.min.js\"\u003e\u003c/script\u003e\n```\n#### Usage\n```html\n\u003cscript\u003e\n  tinyLocalStorage.set('user', {\n    name: 'Ali',\n    surname: 'Gasymov'\n  });\n\n  tinySessionStorage.set('user', {\n    name: 'Ali',\n    surname: 'Gasymov'\n  });\n\u003c/script\u003e\n```\n\n## Methods\n### `key(index)`\nWhen passed a number n, returns the name of the nth key in the storage. The order of keys is user-agent defined, so you should not rely on it.\n\n```javascript\ntinyLocalStorage.key(0);\n\ntinySessionStorage.key(0);\n```\n### `get(keyName)`\nWhen passed a key name, will return that key's value or null if the key does not exist.\n\n```javascript\ntinyLocalStorage.get('user');\n\ntinySessionStorage.get('user');\n```\n### `set(keyName, keyValue)`\nWhen passed a key name and value, will add that key to the storage, or update that key's value if it already exists.\n\n```javascript\ntinyLocalStorage.set('user', {\n  name: 'Ali',\n  surname: 'Gasymov'\n});\n\ntinySessionStorage.set('user', {\n  name: 'Ali',\n  surname: 'Gasymov'\n});\n```\n### `remove(keyName)`\nWhen passed a key name, will remove that key from the storage if it exists. If there is no item associated with the given key, this method will do nothing.\n\n```javascript\ntinyLocalStorage.remove('user');\n\ntinySessionStorage.remove('user');\n```\n### `clear()`\nWhen invoked, clears all stored keys.\n\n```javascript\ntinyLocalStorage.clear();\n\ntinySessionStorage.clear();\n```\n\n## Properties\n### `length`\nReturns an integer representing the number of data items stored in the storage.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falik0211%2Ftiny-storage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falik0211%2Ftiny-storage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falik0211%2Ftiny-storage/lists"}