{"id":13614568,"url":"https://github.com/gadingnst/simple-webstorage","last_synced_at":"2025-10-13T13:08:13.505Z","repository":{"id":56615301,"uuid":"175548376","full_name":"gadingnst/simple-webstorage","owner":"gadingnst","description":"Lightweight utilities that can make easier to access application storage in client browser.","archived":false,"fork":false,"pushed_at":"2024-08-28T09:43:38.000Z","size":77,"stargazers_count":12,"open_issues_count":10,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-13T13:07:47.895Z","etag":null,"topics":["javascript","javascript-library","javascript-utility","local-storage","npm-package","session-cookie","web-storage"],"latest_commit_sha":null,"homepage":"https://sutanlab.js.org/simple-webstorage","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/gadingnst.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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,"zenodo":null},"funding":{"ko_fi":"gadingnst","custom":["https://trakteer.id/gadingnst","https://karyakarsa.com/gadingnst"]}},"created_at":"2019-03-14T04:31:36.000Z","updated_at":"2025-10-03T20:34:01.000Z","dependencies_parsed_at":"2025-05-07T11:47:09.489Z","dependency_job_id":"f434883b-3b95-417b-ab48-6a8beda05ab3","html_url":"https://github.com/gadingnst/simple-webstorage","commit_stats":null,"previous_names":["sutanlab/simple-webstorage"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gadingnst/simple-webstorage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gadingnst%2Fsimple-webstorage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gadingnst%2Fsimple-webstorage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gadingnst%2Fsimple-webstorage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gadingnst%2Fsimple-webstorage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gadingnst","download_url":"https://codeload.github.com/gadingnst/simple-webstorage/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gadingnst%2Fsimple-webstorage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279015279,"owners_count":26085683,"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-10-13T02:00:06.723Z","response_time":61,"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":["javascript","javascript-library","javascript-utility","local-storage","npm-package","session-cookie","web-storage"],"created_at":"2024-08-01T20:01:03.252Z","updated_at":"2025-10-13T13:08:13.463Z","avatar_url":"https://github.com/gadingnst.png","language":"JavaScript","readme":"# Simple Web Storage\n\n[![GitHub](https://img.shields.io/github/license/sutanlab/simple-webstorage.svg)](https://github.com/sutanlab/simple-webstorage) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/a3575d847c764f659810b1bd725679cf)](https://app.codacy.com/app/sutanlab/simple-webstorage?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=sutanlab/simple-webstorage\u0026utm_campaign=Badge_Grade_Dashboard) [![Build Status](https://travis-ci.org/sutanlab/simple-webstorage.svg?branch=master)](https://travis-ci.org/sutanlab/simple-webstorage) [![npm](https://img.shields.io/npm/v/simple-webstorage.svg)](https://www.npmjs.com/package/simple-webstorage) [![npm](https://img.shields.io/npm/dt/simple-webstorage.svg)](https://npm-stat.com/charts.html?package=simple-webstorage) [![npm](https://img.shields.io/bundlephobia/min/simple-webstorage.svg)](https://unpkg.com/simple-webstorage/lib/bundle/simple-webstorage.min.js) [![David](https://img.shields.io/david/dev/sutanlab/simple-webstorage.svg)](https://www.npmjs.com/package/simple-webstorage?activeTab=dependencies) [![GitHub issues](https://img.shields.io/github/issues/sutanlab/simple-webstorage.svg)](https://github.com/sutanlab/simple-webstorage/issues) [![Website](https://img.shields.io/website/https/sutanlab.js.org/simple-webstorage.svg)](https://sutanlab.js.org/simple-webstorage)\n\n\u003e Lightweight utilities that can make easier to write and read application storage in client browser.\n\n### Support :\n- Local Storage\n- Cookie Storage\n- Session Storage\n\n---\n\n## HOW TO USE\n\n### 1. Use Package with NPM or YARN\n\n```bash\n# with npm\n$ npm i simple-webstorage --save\n\n# or with yarn\n$ yarn add simple-webstorage\n```\n\n#### All API import\n\n```js\nimport SimpleWebStorage from 'simple-webstorage'\n\nconst storage = SimpleWebStorage()\n\nstorage.local.set('key', 'value') // empty the third parameter to store data permanently (only affected in local)\nstorage.cookie.set('key', 'value', 5)\nstorage.session.set('key', 'value', 5)\n```\n\n#### Partial API import\n\n```js\n// # for local storage\nimport { get as getLocalStorage, set as setLocalStorage } from 'simple-webstorage/lib/local'\n\n// # for session storage\n// import { get, set } from 'simple-webstorage/lib/session'\n\n// # for cookie storage\n// import { get, set } from 'simple-webstorage/lib/cookie'\n\nsetLocalStorage('key', {\n  name: 'you',\n  skill: [\n    'angry',\n    'crying'\n  ]\n}) \n\nconsole.log(getLocalStorage('key')) // { name: 'you', skill: ['angry', 'crying'] }\n```\n\n##### or you can import partial API like this :\n\n```js\n// # for cookie storage\nimport CookieStorage from 'simple-webstorage/lib/cookie'\n\n// # for local storage\n// import LocalStorage from 'simple-webstorage/lib/local'\n\n// # for session storage\n// import SessionStorage from 'simple-webstorage/lib/session'\n\nconst cookie = CookieStorage()\n\ncookie.set('remembered', true)\ncookie.set('forgotten', true)\n\nconsole.log(cookie.get('remembered')) // true # get values from key. returns any\nconsole.log(cookie.keys()) // ['remembered', 'forgotten'] # list all keys. returns array\n```\n\n### 2. All in minified js\n\n```html\n\u003cscript type=\"text/javascript\" src=\"https://unpkg.com/simple-webstorage/lib/bundle/simple-webstorage.min.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\"\u003e\n  var storage = SimpleWebStorage();\n\n  storage.local.set('key', 'value');\n  storage.cookie.set('key', 'value', 5);\n  storage.session.set('key', 'value', 5);\n\u003c/script\u003e\n```\n\n## API Details\n\n| Storage   | Method      | Parameters                                                                                  |\n|-----------|-------------|---------------------------------------------------------------------------------------------|\n| `local`   | set         | `key` (type: String), `value` (type: any, default: 0), `expiryInMinutes` (type: Number, default: null)  |\n| `cookie` or `session`  | set         | `key` (type: String), `value` (type: any, default: 0), `expiryInMinutes` (type: Number, default: 5)     |\n| `local` or `cookie` or `session`  | get         | `key` (type: String)                                                           |\n| `local` or `cookie` or `session`  | remove      | `key` (type: String)                                                                        |\n| `local` or `cookie` or `session`  | keys        |  none                                                                                       |\n| `local` or `cookie` or `session`  | clear       |  none                                                                               |\n\n## Support Me\n### Global\n[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/gadingnst)\n### Indonesia\n- [Trakteer](https://trakteer.id/gadingnst)\n- [Karyakarsa](https://karyakarsa.com/gadingnst)\n\n---\nFeel free to contribute [simple-webstorage](https://github.com/sutanlab/simple-webstorage) 🙂\n\nCopyright © 2019 by Sutan Gading Fadhillah Nasution\n","funding_links":["https://ko-fi.com/gadingnst","https://trakteer.id/gadingnst","https://karyakarsa.com/gadingnst"],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgadingnst%2Fsimple-webstorage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgadingnst%2Fsimple-webstorage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgadingnst%2Fsimple-webstorage/lists"}