Async-localstorage
Asynchronous local storage
Report Bug
·
Request Feature
·
See on NPM
About The Project
Asynchronous local storage operation. 🔥
Provides setItem and getItem promises.
Built With
Async-localstorage is extremely light weight and built with:
- Typescript
Getting Started
Async-localstorage can be used with any web based projects and frameworks such as React, Angular etc.
Installation
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
Usage
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) {
...
}
}
Roadmap
See the open issues for the list of known issues.
See the Product board for the list of proposed features
Contributing
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
License
Distributed under the MIT License. See LICENSE
for more information.