{"id":27689577,"url":"https://github.com/createnextapp/async-local-storage","last_synced_at":"2026-06-18T20:41:52.731Z","repository":{"id":57104355,"uuid":"256403754","full_name":"createnextapp/async-local-storage","owner":"createnextapp","description":"AsyncLocalStorage is an unencrypted, asynchronous, persistent, key-value storage system that is global to the app in web browser. It should be used instead of LocalStorage.","archived":false,"fork":false,"pushed_at":"2020-05-30T12:14:24.000Z","size":835,"stargazers_count":28,"open_issues_count":3,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-05T11:23:15.517Z","etag":null,"topics":["angular","app","async","async-await","asynchronous","asyncstorage","javascript","local-async-storage","local-storage","localasyncstorage","localstorage","react","storage","vue","web"],"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/createnextapp.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":"2020-04-17T04:47:34.000Z","updated_at":"2025-06-10T15:43:43.000Z","dependencies_parsed_at":"2022-08-20T17:10:52.138Z","dependency_job_id":null,"html_url":"https://github.com/createnextapp/async-local-storage","commit_stats":null,"previous_names":["bunlong/local-async-storage"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/createnextapp/async-local-storage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/createnextapp%2Fasync-local-storage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/createnextapp%2Fasync-local-storage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/createnextapp%2Fasync-local-storage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/createnextapp%2Fasync-local-storage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/createnextapp","download_url":"https://codeload.github.com/createnextapp/async-local-storage/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/createnextapp%2Fasync-local-storage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34507160,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"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":["angular","app","async","async-await","asynchronous","asyncstorage","javascript","local-async-storage","local-storage","localasyncstorage","localstorage","react","storage","vue","web"],"created_at":"2025-04-25T10:24:55.948Z","updated_at":"2026-06-18T20:41:52.713Z","avatar_url":"https://github.com/createnextapp.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# async-local-storage\n\nAsyncLocalStorage is an unencrypted, asynchronous, persistent, key-value storage system that is global to the app in web browser. It should be used instead of LocalStorage.\n\n[![NPM](https://img.shields.io/npm/v/async-local-storage.svg)](https://www.npmjs.com/package/@createnextapp/async-local-storage) ![npm bundle size](https://img.shields.io/bundlephobia/min/@createnextapp/async-local-storage)\n\n## ❓ Why AsyncLocalStorage instead of LocalStorage?\n\n**Cons of LocalStorage**\n\nLocalStorage is synchronous, each local storage operation you run will be one-at-a-time. For complex applications this is a big no-no as it'll slow down your app's runtime.\n\n**Pros of AsyncLocalStorage**\n\nAsyncLocalStorage is asynchronous, each local async storage operation you run will be multi-at-a-time. It'll speed up your app's runtime.\n\nThe AsyncLocalStorage JavaScript code is a facade that provides [a clear JavaScript API](./API.md), real Error objects, and non-multi functions. Each method in the API returns a Promise object.\n\n## 🔧 Install\n\nasync-local-storage is available on npm. It can be installed with the following command:\n\n```\nnpm install --save @createnextapp/async-local-storage\n```\n\nasync-local-storage is available on yarn as well. It can be installed with the following command:\n\n```\nyarn add @createnextapp/async-local-storage\n```\n\n## 💡 Usage\n\nTo learn more how to use async-local-storage:\n\n* [API Documentation](./API.md)\n\n### Import \n\n```js\nimport AsyncLocalStorage from '@createnextapp/async-local-storage'\n```\n\n### Store data\n\n```js\nstoreData = async () =\u003e {\n  try {\n    await AsyncLocalStorage.setItem('@key', 'value')\n  } catch(e) {\n    // error\n  }\n}\n```\n\n### Read data\n\n```js\nreadData = async () =\u003e {\n  let data\n\n  try {\n    data = await AsyncLocalStorage.getItem('@key')\n  } catch(e) {\n    // error\n  }\n\n  console.log(data)\n\n  /*\n    output: \n    value\n  */\n}\n```\n\n## 💖 Wrap Up\n\nIf you think any of the `async-local-storage` can be improved, please do open a PR with any updates and submit any issues. Also, I will continue to improve this, so you might want to watch/star this repository to revisit.\n\n## 🌟 Contribution\n\nWe'd love to have your helping hand on contributions to `async-local-storage` by forking and sending a pull request!\n\nYour contributions are heartily ♡ welcome, recognized and appreciated. (✿◠‿◠)\n\nHow to contribute:\n\n- Open pull request with improvements\n- Discuss ideas in issues\n- Spread the word\n- Reach out with any feedback\n\n## ⚖️ License\n\nThe MIT License [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreatenextapp%2Fasync-local-storage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcreatenextapp%2Fasync-local-storage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreatenextapp%2Fasync-local-storage/lists"}