Asynchronous local storage
Report Bug
·
Request Feature
·
See on NPM
Asynchronous local storage operation. 🔥
Provides setItem and getItem promises.
Async-localstorage is extremely light weight and built with:
- Typescript
Async-localstorage can be used with any web based projects and frameworks such as React, Angular etc.
Async-localstorage requires Node to be installed in order to use yarn/npm.
-
npm
npm i @paanSinghCoder/async-localstorage
-
yarn
yarn add @paanSinghCoder/async-localstorage
-
pnpm
pnpm i @paanSinghCoder/async-localstorage
After installation import Async-localstorage to your project :
// Import this as
import { asyncLocalStorage } from '@paanSinghCoder/async-localstorage'
...
const getName = async () => {
try {
const someName = await asyncLocalStorage.getItem('name')
} catch (err) {
...
}
}
const setName = async (newName) => {
try {
await asyncLocalStorage.setItem('name', newName)
} catch (err) {
...
}
}
See the open issues for the list of known issues.
See the Product board for the list of proposed features
Consider starring this project on Github.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.