1.0.4 • Published 8 months ago

@jafferson/simple-local-storage v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Simple Local Storage

Simple Local Storage is a JavaScript module that provides a straightforward alternative to async storage. This module simplifies the process of storing and retrieving data locally in your web or mobile applications. It is particularly useful for projects using frameworks like React Native or Expo.

Installation

You can install Simple Local Storage via npm or yarn:

npm install @jafferson/simple-local-storage
# or
yarn add @jafferson/simple-local-storage

Usage

Here's a quick example of how to use Simple Local Storage in your JavaScript or TypeScript project:

import Storage from '@jafferson/simple-local-storage';

// Store data
Storage.setItem('myKey', 'myValue');

// Retrieve data
const myValue = Storage.getItem('myKey');
console.log(myValue); // 'myValue'

// Remove data
Storage.removeItem('myKey');

// get all keys
const allKeys = Storage.getAllKeys();
allKeys.forEach(key => { Storage.removeItem(key) }) //remove all keys

API

setItem(key: string, value: any): void

Stores the specified value under the given key.

getItem(key: string): string | null

Retrieves the value associated with the specified key.

removeItem(key: string): void

Removes the item associated with the specified key.

getAllKeys(): string[]

get all keys from the storage.

Issues

If you encounter any issues or have suggestions for improvements, please report them on GitHub Issues.

License

Simple Local Storage is released under the MIT License.

Author

  • Jafferson Oliveira
  • Email: jaffersonadm@hotmail.com

Acknowledgments

This project relies on the expo-file-system library.

More Information

For more information and detailed examples, visit the GitHub repository or NPM page.


Thank you for using Simple Local Storage! We hope it simplifies your data storage needs in your projects. If you find it helpful, please consider giving it a star on GitHub.

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago