{"_id":"@diaskappassov/hungry-local-storage","_rev":"7-d65ee51597231b9f0a1f36c88e653847","name":"@diaskappassov/hungry-local-storage","dist-tags":{"latest":"1.0.1"},"versions":{"0.0.1":{"name":"@diaskappassov/hungry-local-storage","version":"0.0.1","description":"💾⌛ Local storage tool but with expiration time (auto delete expired data).","main":"./lib/cjs/index.js","module":"./lib/esm/index.js","type":"module","scripts":{"build":"tsc -p tsconfig.json && tsc -p tsconfig-cjs.json","test":" find -name \"*test.ts\" | xargs node --loader tsx --test"},"repository":{"type":"git","url":"git+https://github.com/Dias1c/hungry-local-storage.git"},"keywords":["localStorage","local storage","temporaryLocalStorage","temporary local storage","browser","storage","expiration","auto delete"],"author":{"name":"Dias Kappassov"},"license":"MIT","bugs":{"url":"https://github.com/Dias1c/hungry-local-storage/issues"},"homepage":"https://github.com/Dias1c/hungry-local-storage#readme","devDependencies":{"@types/node":"^20.8.9","tsx":"^3.14.0"},"gitHead":"7c16b895f43587dcf394d05ca8e0941e23a37382","_id":"@diaskappassov/hungry-local-storage@0.0.1","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-mVAnFfbsWkutgjavFtK3WMrxrBiMoC2/W/RIXAPSLuUDDfQC1N3Jwppr+l3Vxus6LzCCw3LuPb8I1GTcc11D3Q==","shasum":"452853361f423ce5cb99341ad3e09635766171c1","tarball":"https://registry.npmjs.org/@diaskappassov/hungry-local-storage/-/hungry-local-storage-0.0.1.tgz","fileCount":2,"unpackedSize":1532,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG9UYsBuxP1SjEu1pu4vZhMpDp8F/7ZyTfV25ls7WsceAiEA/UPvYMC43ufDIdkSRPYEeA6cKkH29yvZcpipJXs5hU8="}]},"_npmUser":{"name":"diaskappassov","email":"diaskappassov@gmail.com"},"directories":{},"maintainers":[{"name":"diaskappassov","email":"diaskappassov@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hungry-local-storage_0.0.1_1699276005376_0.7521523583229963"},"_hasShrinkwrap":false},"0.1.0":{"name":"@diaskappassov/hungry-local-storage","version":"0.1.0","description":"💾⌛ Local storage tool but with expiration time (auto delete expired data).","main":"./lib/cjs/index.js","module":"./lib/esm/index.js","type":"module","scripts":{"build":"tsc -p tsconfig.json && tsc -p tsconfig-cjs.json","test":" find -name \"*test.ts\" | xargs node --loader tsx --test","prepublishOnly":"npm run test && npm run build"},"repository":{"type":"git","url":"git+https://github.com/Dias1c/hungry-local-storage.git"},"keywords":["localStorage","local storage","temporaryLocalStorage","temporary local storage","browser","storage","expiration","auto delete"],"author":{"name":"Dias Kappassov"},"license":"MIT","bugs":{"url":"https://github.com/Dias1c/hungry-local-storage/issues"},"homepage":"https://github.com/Dias1c/hungry-local-storage#readme","devDependencies":{"@types/node":"^20.8.9","tsx":"^3.14.0"},"types":"./lib/cjs/index.d.ts","gitHead":"1edb6c6552fc120aaffd33b95a944314675bfcc2","_id":"@diaskappassov/hungry-local-storage@0.1.0","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-gPvrGFlBPYhvPZx6q8bS0Bc9M+zVLRsH+8T09kxjdX3JbcnveP+vOfjLSXtFYrSc3aCva82guePC3TNhps9ZkQ==","shasum":"2a40c873370266d8cb3c5590a7212433c5d967bc","tarball":"https://registry.npmjs.org/@diaskappassov/hungry-local-storage/-/hungry-local-storage-0.1.0.tgz","fileCount":42,"unpackedSize":20156,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE+gJgo66P2tZhhA9CV9lBIk4a9Yk/EYsYOsQbSDjCR/AiEA7S/Uno0D3xNAbHMZdTSRwXZDR+jKE1/Qx31R7e3oG2I="}]},"_npmUser":{"name":"diaskappassov","email":"diaskappassov@gmail.com"},"directories":{},"maintainers":[{"name":"diaskappassov","email":"diaskappassov@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hungry-local-storage_0.1.0_1699296936013_0.895877531132081"},"_hasShrinkwrap":false},"0.1.1":{"name":"@diaskappassov/hungry-local-storage","version":"0.1.1","description":"💾⌛ Local storage tool but with expiration time (auto delete expired data).","main":"./lib/cjs/index.js","module":"./lib/esm/index.js","type":"module","scripts":{"build":"tsc -p tsconfig.json && tsc -p tsconfig-cjs.json","test":" find -name \"*test.ts\" | xargs node --loader tsx --test","prepublishOnly":"npm run test && npm run build"},"repository":{"type":"git","url":"git+https://github.com/Dias1c/hungry-local-storage.git"},"keywords":["localStorage","local storage","temporaryLocalStorage","temporary local storage","browser","storage","expiration","auto delete"],"author":{"name":"Dias Kappassov"},"license":"MIT","bugs":{"url":"https://github.com/Dias1c/hungry-local-storage/issues"},"homepage":"https://github.com/Dias1c/hungry-local-storage#readme","devDependencies":{"@types/node":"^20.8.9","tsx":"^3.14.0"},"types":"./lib/cjs/index.d.ts","gitHead":"7be810df14a41a72a97cfbb74a2cbf97032d5d40","_id":"@diaskappassov/hungry-local-storage@0.1.1","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-5/C1JtNH7rfb4eQSl/xVbfjlvwOVqxgP46D8JbO2Xl2y+/1tuxgjhcNWuZ1R4sNZFMNDZyKcs8XB8EUT6+cVHw==","shasum":"c60bc405ec96e9895c7fde8289dd01a40857baa4","tarball":"https://registry.npmjs.org/@diaskappassov/hungry-local-storage/-/hungry-local-storage-0.1.1.tgz","fileCount":42,"unpackedSize":29291,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD2czJh/NAUJxV9B8LG/eUJa9aQbWnhA46rfr54ILbn8AIgZ+wOTAeTSm7sW+F0hRgtE8bkfp1jdxr10S4gJgk5QBU="}]},"_npmUser":{"name":"diaskappassov","email":"diaskappassov@gmail.com"},"directories":{},"maintainers":[{"name":"diaskappassov","email":"diaskappassov@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hungry-local-storage_0.1.1_1699300572166_0.21218504037785602"},"_hasShrinkwrap":false},"0.1.2":{"name":"@diaskappassov/hungry-local-storage","version":"0.1.2","description":"💾⌛ Local storage tool but with expiration time (auto delete expired data).","main":"./lib/cjs/index.js","module":"./lib/esm/index.js","type":"module","scripts":{"build":"tsc -p tsconfig.json && tsc -p tsconfig-cjs.json","test":" find -name \"*test.ts\" | xargs node --loader tsx --test","prepublishOnly":"npm run test && npm run build"},"repository":{"type":"git","url":"git+https://github.com/Dias1c/hungry-local-storage.git"},"keywords":["localStorage","local storage","temporaryLocalStorage","temporary local storage","browser","storage","expiration","auto delete"],"author":{"name":"Dias Kappassov"},"license":"MIT","bugs":{"url":"https://github.com/Dias1c/hungry-local-storage/issues"},"homepage":"https://github.com/Dias1c/hungry-local-storage#readme","devDependencies":{"@types/node":"^20.8.9","tsx":"^3.14.0"},"types":"./lib/cjs/index.d.ts","gitHead":"922b53cf846cbfc91285e6596a8133a98196d8ef","_id":"@diaskappassov/hungry-local-storage@0.1.2","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-98Vm8lz/1yBex9KkdtnrKJMHBDNXWY/zJopC6QeuaOxio9t4A8V3XQrsVJzAdGobwBWlUxNyDqzLPF97fXXsNA==","shasum":"b9735d89d865e0a891e2adb8fdd7312e4d1a4bde","tarball":"https://registry.npmjs.org/@diaskappassov/hungry-local-storage/-/hungry-local-storage-0.1.2.tgz","fileCount":43,"unpackedSize":30362,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+h2JrFuLuL/aW2Q0T4C7ESskgIhX42SQNWEaAiKT3TwIgISA6wYXSU/BquKfDfPpFRaMQJfaThikmjdszlCdMdBY="}]},"_npmUser":{"name":"diaskappassov","email":"diaskappassov@gmail.com"},"directories":{},"maintainers":[{"name":"diaskappassov","email":"diaskappassov@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hungry-local-storage_0.1.2_1699302639346_0.5167428351165255"},"_hasShrinkwrap":false},"0.1.3":{"name":"@diaskappassov/hungry-local-storage","version":"0.1.3","description":"💾⌛ Local storage tool but with expiration time (auto delete expired data).","main":"./lib/cjs/index.js","module":"./lib/esm/index.js","type":"module","scripts":{"build":"tsc -p tsconfig.json && tsc -p tsconfig-cjs.json","test":" find -name \"*test.ts\" | xargs node --loader tsx --test","prepublishOnly":"npm run test && npm run build"},"repository":{"type":"git","url":"git+https://github.com/Dias1c/hungry-local-storage.git"},"keywords":["localStorage","local storage","temporaryLocalStorage","temporary local storage","local storage with expiration","auto delete","auto clean","browser"],"author":{"name":"Dias Kappassov"},"license":"MIT","bugs":{"url":"https://github.com/Dias1c/hungry-local-storage/issues"},"homepage":"https://github.com/Dias1c/hungry-local-storage#readme","devDependencies":{"@types/node":"^20.8.9","tsx":"^3.14.0"},"types":"./lib/cjs/index.d.ts","gitHead":"a52cdaee4823e38e2d47502333c87d668f5f840f","_id":"@diaskappassov/hungry-local-storage@0.1.3","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-92dxuiYBFBysdPo0yLwooq3/pomdvYLmyed3itN+HTDoVdOhFXg19i31oVNvqvn907vN6vEpuGtfBxFTPrtZFA==","shasum":"5c264243493f93b993a398fc2018f5fe8a98166a","tarball":"https://registry.npmjs.org/@diaskappassov/hungry-local-storage/-/hungry-local-storage-0.1.3.tgz","fileCount":43,"unpackedSize":32114,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCEB1bLPG+wrweoeTDhvA/WdPcqga7mdzc+Ix1gVZ8INQIhAJXnwI5VqYf2AJ01A7MPDAeM8fDOAQzWeRdCClvjZ1NI"}]},"_npmUser":{"name":"diaskappassov","email":"diaskappassov@gmail.com"},"directories":{},"maintainers":[{"name":"diaskappassov","email":"diaskappassov@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hungry-local-storage_0.1.3_1699370140437_0.7630475488144206"},"_hasShrinkwrap":false},"0.1.4":{"name":"@diaskappassov/hungry-local-storage","version":"0.1.4","description":"💾⌛ Tool for store temporary data in local storage (with autodelete expired data).","main":"./lib/cjs/index.js","module":"./lib/esm/index.js","type":"module","scripts":{"build":"tsc -p tsconfig.json && tsc -p tsconfig-cjs.json","test":" find -name \"*test.ts\" | xargs node --loader tsx --test","prepublishOnly":"npm run test && npm run build","demo":"npm run prepublishOnly && live-server"},"repository":{"type":"git","url":"git+https://github.com/Dias1c/hungry-local-storage.git"},"keywords":["localStorage","local storage","temporaryLocalStorage","temporary local storage","local storage with expiration","auto clean local storage","browser"],"author":{"name":"Dias Kappassov"},"license":"MIT","bugs":{"url":"https://github.com/Dias1c/hungry-local-storage/issues"},"homepage":"https://github.com/Dias1c/hungry-local-storage#readme","devDependencies":{"@types/node":"^20.8.9","install":"^0.13.0","live-server":"^1.2.2","npm":"^10.2.4","tsx":"^3.14.0"},"types":"./lib/cjs/index.d.ts","gitHead":"e9909513a8edf3321431e651c2812476bb29ee55","_id":"@diaskappassov/hungry-local-storage@0.1.4","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-Q88fGFM1y2KrxZcGOH0iFZQLGNOfy2UYncptjqBfeoz72tBeeCC8Xi9b+H04o3A6Soocz2tdl9jMr6KDcrtLwA==","shasum":"a9819cbb30c0829c0169bf55a70d76800153d2cd","tarball":"https://registry.npmjs.org/@diaskappassov/hungry-local-storage/-/hungry-local-storage-0.1.4.tgz","fileCount":43,"unpackedSize":33173,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHov1jl4UcBOPZSlT+vQ/sMEk3m2CA9gFn8Kj3tesaCKAiEA79b2sUYQZGwaFw4Vb87sxZ6g7bfOo9HwxhJ1MjaXWpI="}]},"_npmUser":{"name":"diaskappassov","email":"diaskappassov@gmail.com"},"directories":{},"maintainers":[{"name":"diaskappassov","email":"diaskappassov@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hungry-local-storage_0.1.4_1701333575495_0.4454319835667251"},"_hasShrinkwrap":false},"1.0.0":{"name":"@diaskappassov/hungry-local-storage","version":"1.0.0","description":"💾⌛ Tool for store temporary data in local storage (with autodelete expired data).","main":"./lib/cjs/index.js","module":"./lib/esm/index.js","type":"module","scripts":{"build":"tsc -p tsconfig.json && tsc -p tsconfig-cjs.json","test":" find -name \"*test.ts\" | xargs node --loader tsx --test","prepublishOnly":"npm run test && npm run build","demo":"npm run prepublishOnly && live-server"},"repository":{"type":"git","url":"git+https://github.com/Dias1c/hungry-local-storage.git"},"keywords":["localStorage","local storage","temporaryLocalStorage","temporary local storage","local storage with expiration","auto clean local storage","browser"],"author":{"name":"Dias Kappassov"},"license":"MIT","bugs":{"url":"https://github.com/Dias1c/hungry-local-storage/issues"},"homepage":"https://github.com/Dias1c/hungry-local-storage#readme","devDependencies":{"@types/node":"^20.8.9","install":"^0.13.0","live-server":"^1.2.2","npm":"^10.2.4","tsx":"^3.14.0"},"types":"./lib/cjs/index.d.ts","gitHead":"c1da8e5bddeba4f596434019619a0c55ac064fa1","_id":"@diaskappassov/hungry-local-storage@1.0.0","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-y/Xd0h1+OyTXBtI8e0akI4WiW/vUn2ls++QtmYo5yROJp1E1iuPXN0mbsFWhWysV2CjY8teHqKNLdXwPTd16iA==","shasum":"a597408f38fbedea62b0f532e312b31e38946d71","tarball":"https://registry.npmjs.org/@diaskappassov/hungry-local-storage/-/hungry-local-storage-1.0.0.tgz","fileCount":43,"unpackedSize":33173,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA8t/mIa3HFtnhSThKzjMl1pm14v37tUh3JeOYIDcRx7AiEA9s3aBNSehIca1EdSJy3j+xeOrKDUAhE+l0xNmVekkUY="}]},"_npmUser":{"name":"diaskappassov","email":"diaskappassov@gmail.com"},"directories":{},"maintainers":[{"name":"diaskappassov","email":"diaskappassov@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hungry-local-storage_1.0.0_1701334133860_0.902886747014294"},"_hasShrinkwrap":false},"1.0.1":{"name":"@diaskappassov/hungry-local-storage","version":"1.0.1","description":"💾⌛ Tool for store temporary data in local storage (with autodelete expired data).","main":"./lib/cjs/index.js","module":"./lib/esm/index.js","type":"module","exports":{".":{"require":"./lib/cjs/index.js","import":"./lib/esm/index.js"}},"scripts":{"build":"tsc -p tsconfig.json && tsc -p tsconfig-cjs.json","test":" find -name \"*test.ts\" | xargs node --loader tsx --test","prepublishOnly":"npm run test && npm run build","demo":"npm run prepublishOnly && live-server"},"repository":{"type":"git","url":"git+https://github.com/Dias1c/hungry-local-storage.git"},"keywords":["localStorage","local storage","temporaryLocalStorage","temporary local storage","local storage with expiration","auto clean local storage","browser"],"author":{"name":"Dias Kappassov"},"license":"MIT","bugs":{"url":"https://github.com/Dias1c/hungry-local-storage/issues"},"homepage":"https://github.com/Dias1c/hungry-local-storage#readme","devDependencies":{"@types/node":"^20.8.9","install":"^0.13.0","live-server":"^1.2.2","npm":"^10.2.4","tsx":"^3.14.0"},"types":"./lib/cjs/index.d.ts","gitHead":"e16fd622301da3bc029665700fb883ebc55cedc1","_id":"@diaskappassov/hungry-local-storage@1.0.1","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-lDVasnDLrAurbfDUgE2aibxzbAFz4tIKgF74jV4vvkO5z2vTc09Lad/Im3empf6yCOgGmKIWItF4WKOEC519jA==","shasum":"6698cb9c80cd7a9ac6a7112f6686a93f1fe68994","tarball":"https://registry.npmjs.org/@diaskappassov/hungry-local-storage/-/hungry-local-storage-1.0.1.tgz","fileCount":43,"unpackedSize":33286,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA7Aj2GDlAECJpoqYIBW/BQ6Wu88Y4L9AwcW7R9U8KrjAiBWK/RzKbHdTy+c3d0LQ19Yh8e/8rSzKd5EpZW6LpXkTQ=="}]},"_npmUser":{"name":"diaskappassov","email":"diaskappassov@gmail.com"},"directories":{},"maintainers":[{"name":"diaskappassov","email":"diaskappassov@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hungry-local-storage_1.0.1_1701362598178_0.43583189851933035"},"_hasShrinkwrap":false}},"time":{"created":"2023-11-06T13:06:45.298Z","0.0.1":"2023-11-06T13:06:45.579Z","modified":"2023-11-30T16:43:18.515Z","0.1.0":"2023-11-06T18:55:36.231Z","0.1.1":"2023-11-06T19:56:12.361Z","0.1.2":"2023-11-06T20:30:39.541Z","0.1.3":"2023-11-07T15:15:40.663Z","0.1.4":"2023-11-30T08:39:35.643Z","1.0.0":"2023-11-30T08:48:54.009Z","1.0.1":"2023-11-30T16:43:18.352Z"},"maintainers":[{"name":"diaskappassov","email":"diaskappassov@gmail.com"}],"description":"💾⌛ Tool for store temporary data in local storage (with autodelete expired data).","homepage":"https://github.com/Dias1c/hungry-local-storage#readme","keywords":["localStorage","local storage","temporaryLocalStorage","temporary local storage","local storage with expiration","auto clean local storage","browser"],"repository":{"type":"git","url":"git+https://github.com/Dias1c/hungry-local-storage.git"},"author":{"name":"Dias Kappassov"},"bugs":{"url":"https://github.com/Dias1c/hungry-local-storage/issues"},"license":"MIT","readme":"# hungry-local-storage\n\n💾⌛ Tool for store temporary data in local storage (with autodelete expired data).\n\n<p align=\"center\">\n  <img alt=\"ts\" src=\"https://badgen.net/badge/-/TypeScript?icon=typescript&label&labelColor=blue&color=555555\">\n  <a href=\"https://www.npmjs.com/package/@diaskappassov/hungry-local-storage\">\n    <img alt=\"Visit the NPM page\" src=\"https://img.shields.io/npm/v/@diaskappassov/hungry-local-storage\"/>\n  </a>\n  <a href=\"https://github.com/Dias1c/hungry-local-storage/\">\n    <img alt=\"Visit package GitHub page\" src=\"https://img.shields.io/github/stars/Dias1c/hungry-local-storage?style=social&label=GitHub&maxAge=2592000\"/>\n  </a>\n</p>\n\n## About\n\nThis is a simple tool for storing data in localStorage with expiration time. It's useful for storing temporary data, such as user preferences, but also for storing data that is not needed after a certain period of time.\n\n### Why hungry-local-storage?\n\nThe reason why I called this package `hungry-local-storage` is that he is endlessly hungry thats allowed to eat only after the item's store time expires. And it checks at specified intervals (every N seconds you specify) whether the object's storage period has expired so that it can be eaten. Such an obedient, hungry tool.\n\n## Usage\n\n### Installing\n\n```sh\n$ npm i \"@diaskappassov/hungry-local-storage\"\n```\n\n### Usage\n\n#### Setting values to localStorage with expiration\n\n```ts\nimport { hls } from \"@diaskappassov/hungry-local-storage\";\n\n// No expire time\nhls.set(\"cherry\", \"string\");\n\nconst curTimestamp = new Date().getTime() / 1000;\n// Expires after 60 seconds\nhls.set(\"banana\", 123, curTimestamp + 60);\n\n// Expires after 3600 seconds\nhls.set(\"apple\", [1, 2, 3], curTimestamp + 3600);\n\n// Expires after 10 minutes\nhls.set(\"avocado\", {}, { minutes: 10 });\n\n// Expires after 3 days\nhls.set(\"tea\", { type: \"green\", count: 2 }, { days: 3 });\n\n// Expires after 7 seconds + 6 minutes + 5 hours + 4 days+ 3 weeks + 2 months + 1 year\nhls.set(\"cake\", \"CAAAKE!\", {\n  seconds: 7,\n  minutes: 6,\n  hours: 5,\n  days: 4,\n  weeks: 3,\n  months: 2,\n  years: 1,\n});\n```\n\n#### Getting value from localStorage\n\nImagine that you run `hls.set(\"apple\", [1, 2, 3], { hours: 1 });`, and you want to get this value from localStorage.\n\n```ts\nimport { hls } from \"@diaskappassov/hungry-local-storage\";\n\n// Returns parsed value if not expired, otherwise returns null with removing expired item from localStorage\nconst apple = hls.get(\"apple\");\n\nconsole.log(apple); // [1, 2, 3]\n```\n\n#### Removing expired items from localStorage\n\n```ts\nimport { hls } from \"@diaskappassov/hungry-local-storage\";\n\n// Removes all expired items and returns count of removed items by function flush\nconst countRemoved = hls.flush();\nconsole.log(\"flush returned:\", countRemoved);\n```\n\n> Don't worry, flush not removes localStorage items that's not have expiration field on top level of structure.\n\n#### Setting Auto Flush\n\nBy default auto flush is disabled. To enable it, execute `setAutoFlush` method with setting values in seconds.\n\n```ts\nimport { hls } from \"@diaskappassov/hungry-local-storage\";\n\n// Set auto flush that runs flush every 10 minutes\nhls.setAutoFlush(60 * 10);\n```\n\n> If you run `setAutoFlush` method twice with different values, then the last value will be used, and it will finish all old `autoFlush` timers.\n\nIf you set auto flush value to `null` then auto flush will be disabled.\n\n```ts\nimport { hls } from \"@diaskappassov/hungry-local-storage\";\n\n// Disable auto flush\nhls.setAutoFlush(null);\n```\n\n#### Removing item from localStorage\n\n```ts\nimport { hls } from \"@diaskappassov/hungry-local-storage\";\n\n// Removes item with key \"apple\".\nhls.remove(\"apple\");\n```\n\n> Under code `hls.remove` just runs `localStorage.removeItem` method\n\n### Structure of created item by hls\n\nAfter running code `hls.set(\"apple\", [1, 2, 3], { hours: 5 });`, in local storage it will be stored as follows:\n\n```js\n{\n  creation: CURRENT_TIMESTAMP,\n  data: \"[1,2,3]\",\n  expiration: CURRENT_TIMESTAMP + HOURS_5,\n}\n```\n\n> Property `expiration` is optional, it means, if expiration is not exists, it will be stored in local storage while you will not delete it.\n\n## License\n\nMIT\n\n## Authors\n\n- [Dias1c](https://github.com/Dias1c)\n","readmeFilename":"README.md"}