{"id":35013796,"url":"https://github.com/nfhipona/web-storage-manager","last_synced_at":"2026-01-20T16:43:29.611Z","repository":{"id":33087439,"uuid":"151400194","full_name":"nfhipona/web-storage-manager","owner":"nfhipona","description":"Web utility storage manager for handling data encryption, save and persist, update and data purge in your local and session storage","archived":false,"fork":false,"pushed_at":"2025-07-22T07:36:21.000Z","size":4841,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-29T01:49:51.939Z","etag":null,"topics":["angularjs","encoded-data","encrypted-store","javascript","local-storage","persistent-storage","reactjs","session-storage","storage","web"],"latest_commit_sha":null,"homepage":"https://nfhipona.github.io/web-storage-manager/","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/nfhipona.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-10-03T11:09:27.000Z","updated_at":"2025-07-22T07:36:18.000Z","dependencies_parsed_at":"2023-07-23T10:14:34.843Z","dependency_job_id":"b9549ad1-a2be-4770-963d-0678efa55d17","html_url":"https://github.com/nfhipona/web-storage-manager","commit_stats":null,"previous_names":["nferocious76/web-storage-manager"],"tags_count":49,"template":false,"template_full_name":null,"purl":"pkg:github/nfhipona/web-storage-manager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfhipona%2Fweb-storage-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfhipona%2Fweb-storage-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfhipona%2Fweb-storage-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfhipona%2Fweb-storage-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nfhipona","download_url":"https://codeload.github.com/nfhipona/web-storage-manager/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfhipona%2Fweb-storage-manager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28072739,"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-12-27T02:00:05.897Z","response_time":58,"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":["angularjs","encoded-data","encrypted-store","javascript","local-storage","persistent-storage","reactjs","session-storage","storage","web"],"created_at":"2025-12-27T05:09:06.650Z","updated_at":"2025-12-27T05:09:08.150Z","avatar_url":"https://github.com/nfhipona.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM](https://nodei.co/npm/web-storage-manager.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/web-storage-manager/)\n\n# Web Storage Manager\n\n[web-storage-manager](https://nfhipona.github.io/web-storage-manager/) is a web development utility for managing web storage to handle save, update and data purge. It has support for storage `data encryption` or just a simple storage `data encoding`. Check out the package in npm registery [here](https://www.npmjs.com/package/web-storage-manager).\n\n\n## Installation\n\n```bash\n\nnpm i web-storage-manager --save\n\n```\n\n\n## Imports\n\n```js\n\nimport { LocalStorage, SessionStorage, EncodedLocalStorage, EncodedSessionStorage } from 'web-storage-manager';\n\n```\n\nor using helper\n\n```js\n\nimport { createLocalStorage, createSessionStorage } from 'web-storage-manager';\n\n// Options conforms to:\n/*\ninterface Options {\n    delimiter?: string,\n    isEncoded: boolean\n}\n*/\n\n// createLocalStorage(window, options)\nconst LocalStorage = createLocalStorage(window, { isEncoded: false });\nconst SessionStorage = createSessionStorage(window, { isEncoded: false });\nconst EncodedLocalStorage = createLocalStorage(window, { isEncoded: true });\nconst EncodedSessionStorage = createSessionStorage(window, { isEncoded: true });\n\n```\n\nor using the base class\n\n```js\n\nimport { WebStorage, EncodedWebStore } from 'web-storage-manager';\n\n// both class has a constructor:\n// constructor(storage: Storage, delimiter: string = '.')\n\nconst LocalStorage = new WebStorage(window.localStorage, delimiter);\nconst SessionStorage = new WebStorage(window.sessionStorage, delimiter);\n\nconst EncodedLocalStorage = new EncodedWebStore(window.localStorage, delimiter);\nconst EncodedSessionStorage = new EncodedWebStore(window.sessionStorage, delimiter);\n\n```\n\n\n#### Using `Encrypted Web Store`\n\n```js\n\nimport { Cryptor, CryptorDefaults, createEncryptedLocalStorage, createEncryptedSessionStorage } from 'web-storage-manager';\n\n/*\nconst CryptorDefaults = {\n    salt: 'salty',\n    keyLength: 24,\n    algorithm: 'aes-192-cbc',\n    password: 'encrypted-web-storage-manager',\n    byteLength: 16 // Buffer\n};\n*/\nconst cryptor = new Cryptor(CryptorDefaults, null);\n\nconst EncryptedLocalStorage = createEncryptedLocalStorage(cryptor /* window, delimiter */);\nconst EncryptedSessionStorage = createEncryptedSessionStorage(cryptor /* window, delimiter */);\n\n```\n\nor using the base class\n\n```js\nimport { Cryptor, CryptorDefaults, EncryptedWebStore } from 'web-storage-manager';\n\n/*\nconst CryptorDefaults = {\n    salt: 'salty',\n    keyLength: 24,\n    algorithm: 'aes-192-cbc',\n    password: 'encrypted-web-storage-manager',\n    byteLength: 16 // Buffer\n};\n*/\nconst cryptor = new Cryptor(CryptorDefaults, null);\nconst WebStorage = new EncryptedWebStore(window.localStorage, cryptor);\n\n```\n\n`NOTES:` make sure to save the value from `cryptor.ivHex` to somewhere safe for later decryption usage.\n\n```js\nimport { Cryptor, CryptorDefaults, EncryptedWebStore } from 'web-storage-manager';\n\n/*\nconst CryptorDefaults = {\n    salt: 'salty',\n    keyLength: 24,\n    algorithm: 'aes-192-cbc',\n    password: 'encrypted-web-storage-manager',\n    byteLength: 16 // Buffer\n};\n*/\nconst oldVectorivHex = 'a17a97ab3...af31ae9';\nconst cryptor = new Cryptor(CryptorDefaults, oldVectorivHex);\nconst OldWebStorage = new EncryptedWebStore(window.localStorage, cryptor);\n\n// then... use as normal\nconst result = OldWebStorage.getItem('npmjs-encrypted');\n// expected result: encrypted-web-storage-manager\n\n```\n\n\n## Usage and Examples\n\nPlease refer to test files `local.test.js` and `session.test.js` for a complete sample and usage.\n\n```js\n\nWebStorage.setItem('sampleKey', 'sampleValue');\n\nconst testObject = {\n    nestedKey: {\n        nestedKeyA: 'nestedKeyA-target-value',\n        nestedKeyB: {\n            nestedKeyC: { itemKey: 'itemKey-value', itemKey2: 'itemKey2-target-value' },\n            nestedKeyD: [{ id: 'id1' }, { id: 'id2' }, { id: 'id3' }, { id: 'idz' }]\n        }\n    }\n};\n\nconst isSuccess = WebStorage.setItem('testKey', testObject);\n// expected result: true\n\nconst item2 = WebStorage.getItemInItem('testKey.nestedKey.nestedKeyA');\n// expected result: nestedKeyA-target-value\n\nconst result = WebStorage.getItemInItem('testKey.nestedKey.nestedKeyB.nestedKeyC');\n// expected result: { itemKey: 'itemKey-value', itemKey2: 'itemKey2-target-value' }\n\nWebStorage.appendItemInItem('testKey.nestedKey.nestedKeyB.nestedKeyC', { appendItemInItemAKey: 'appendItemInItemA-target-appended-value' });\n// expected result: { itemKey: 'itemKey-value', itemKey2: 'itemKey2-target-value', appendItemInItemAKey: 'appendItemInItemA-target-appended-value' }\n\nWebStorage.appendItemInItem('testKey.nestedKey.nestedKeyB.nestedKeyD', { id: 'id4', value: 'appendItemInItemB-target-appended-value' });\n// expected result: [{ id: 'id1' }, { id: 'id2' }, { id: 'id3' }, { id: 'idz' }, { id: 'id4', value: 'appendItemInItemB-target-appended-value' }]\n\nWebStorage.updateItemInItem('testKey.nestedKey.nestedKeyB.nestedKeyD', { name: 'id', value: 'id4' }, { id: 'id4', value: 'appendItemInItemB-target-appended-updated-value' });\n// expected result: [{ id: 'id1' }, { id: 'id2' }, { id: 'id3' }, { id: 'idz' }, { id: 'id4', value: 'appendItemInItemB-target-appended-updated-value' }]\n\nconst result = WebStorage.getItemInItem('testKey.nestedKey.nestedKeyB.nestedKeyC', { name: 'appendItemInItemAKey' });\n// expected result: appendItemInItemA-target-appended-value\n\nconst result = WebStorage.getItemInItem('testKey.nestedKey.nestedKeyB.nestedKeyD', { name: 'id', value: 'id4' });\n// expected result: { id: 'id4', value: 'appendItemInItemB-target-appended-updated-value' }\n\nWebStorage.removeItemInItem('testKey.nestedKey.nestedKeyB.nestedKeyC', { name: 'itemKey2' });\n// expected result: { itemKey: 'itemKey-value', appendItemInItemAKey: 'appendItemInItemA-target-appended-value' }\n\n```\n\n\n#### Using `EncryptedWebStore`\n\nPlease refer to test files `encrypted.test.js` for a complete sample and usage.\n\n```js\n\nconst result = WebStorage.getEncryptedRawItem('testKey');\n// expected result: 97efabdb...303df5b55\n\nconst isSuccess = WebStorage.setItem('testKey', result);\n// expected result: true\n\n```\n\n\n## Available Functions\n\n```js\n\nkey: ƒ key(n)\nlength: ƒ length()\nsetItem: ƒ setItem(key, value)\ngetItem: ƒ getItem(key)\nclear: ƒ clear()\ngetItemInItem: ƒ getItemInItem(key, attrCompare)\ngetMultipleItems: ƒ getMultipleItems(keys)\nappendItemInItem: ƒ appendItemInItem(key, value)\nsetMultipleItems: ƒ setMultipleItems(items)\nupdateItemInItem: ƒ updateItemInItem(key, attrCompare, newValue)\nremoveItem: ƒ removeItem(key)\nremoveItemInItem: ƒ removeItemInItem(key, attrCompare)\nremoveMultipleItems: ƒ removeMultipleItems(keys)\n\n```\n\n\n#### Using `EncryptedWebStore`\n\n```js\n\nsetEncryptedRawItem: ƒ setEncryptedRawItem(key)\ngetEncryptedRawItem: ƒ getEncryptedRawItem(key, value)\n\n```\n\n\n## Unit Test\n\n`Web Storage API Unit Test Result`\n\n\u003cimg width=\"1099\" alt=\"Web Storage API Unit Test Result\" src=\"https://github.com/nfhipona/web-storage-manager/assets/8805997/66e72f6e-52ab-43d9-95ce-6ba0b0e7a077\"\u003e\n\n`Encrypted Storage API Unit Test Result`\n\n\u003cimg width=\"1471\" alt=\"Encrypted Storage API Unit Test Result\" src=\"https://github.com/nfhipona/web-storage-manager/assets/8805997/971b494b-f1f3-42d3-a812-eb01ecf3cf43\"\u003e\n\n## Contribute\nWe would love for you to contribute to `Web Storage Manager`. See the [LICENSE](https://github.com/nfhipona/web-storage-manager/blob/master/LICENSE) file for more info.\n\n\n### About\n\n`Web Storage Manager` is a wrapper built on top of Storage API.\nThis project has grown and had a major revamp in its version 3. And in its version 4, support for encrypted storage is added.\n\n\n## License\n\n`Web Storage Manager` is available under the MIT license. See the [LICENSE](https://github.com/nfhipona/web-storage-manager/blob/master/LICENSE) file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnfhipona%2Fweb-storage-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnfhipona%2Fweb-storage-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnfhipona%2Fweb-storage-manager/lists"}