npm.io
5.0.0 • Published 2 years ago

onedionys-web-storage-abstraction

Licence
ISC
Version
5.0.0
Deps
132
Size
14 kB
Vulns
0
Weekly
0
Stars
13

Welcome to One Dionys - Web Storage Abstraction!

A set of functions to manage web storage including local storage, session storage, and cookies.

Requirements

  • Web Browser - Can be used as an emulator to build applications. Example [Chrome, Firefox, Safari & Opera].
  • Internet - Because many use CDN and to make it easier to find solutions to all problems.

How To Use

Example Syntax
const WebStorage = require('./src/webStorage');

// Create a new instance with localStorage
const localStorageWrapper = new WebStorage('localStorage');

// Set an item
localStorageWrapper.setItem('key', 'value');

// Get an item
const value = localStorageWrapper.getItem('key');
console.log(value); // Output: value

// Remove an item
localStorageWrapper.removeItem('key');

// Clear all items
localStorageWrapper.clear();
Explanation
  • This package provides a simple abstraction layer for working with web storage (localStorage or sessionStorage). It allows you to easily set, get, remove, or clear items from the storage.
Return Value
  • setItem(key, value): Sets the value for the specified key in the storage.
  • getItem(key): Retrieves the value for the specified key from the storage.
  • removeItem(key): Removes the item with the specified key from the storage.
  • clear(): Removes all items from the storage.

Release Date

  • v1.0.0 : 08 March 2024
  • v1.0.1 : 11 March 2024
  • v4.0.0 : 11 March 2024
  • v4.0.1 : 13 March 2024
  • v4.0.2 : 18 March 2024
  • v5.0.0 : 31 March 2024

Author

License

  • Copyright 2024 One Dionys
  • One Dionys - Web Storage Abstraction is an open source project licensed under the MIT license

Suppport & Donation

Love One Dionys - Web Storage Abstraction? Support this project by donating or sharing with others in need.

Made with One Dionys

Keywords