Installation
StorageManager.js can be installed via npm or included directly in your HTML. Choose the method that best fits your project setup.
Package Manager Installation
Section titled “Package Manager Installation”npm install web-storage-manager-jsyarn add web-storage-manager-jspnpm add web-storage-manager-jsThen import it in your JavaScript or TypeScript file:
import StorageManager from 'web-storage-manager-js';
// Create a new instanceconst storage = new StorageManager();CDN Installation
Section titled “CDN Installation”You can include StorageManager.js directly from a CDN:
jsDelivr
Section titled “jsDelivr”<!-- Replace x.y.z with the desired version --><script src="https://cdn.jsdelivr.net/npm/web-storage-manager-js@x.y.z/StorageManager.js"></script>
<script> // StorageManager is now available globally const storage = new StorageManager();</script>Latest Version
Section titled “Latest Version”To always use the latest version (not recommended for production):
<script src="https://cdn.jsdelivr.net/npm/web-storage-manager-js/StorageManager.js"></script>Local Installation
Section titled “Local Installation”You can also download the StorageManager.js file and include it locally:
<script src="path/to/StorageManager.js"></script>Download the latest version from the GitHub repository.
Optional: LZString for Compression
Section titled “Optional: LZString for Compression”If you enable compression (which is enabled by default), StorageManager.js will automatically load LZString from CDN when needed. You don’t need to include it manually.
However, if you want to include it yourself or use it offline:
<script src="https://cdnjs.cloudflare.com/ajax/libs/lz-string/1.5.0/lz-string.min.js"></script><script src="path/to/StorageManager.js"></script>Verification
Section titled “Verification”To verify the installation, try creating a simple instance:
const storage = new StorageManager();console.log('StorageManager loaded successfully!');Next Steps
Section titled “Next Steps”Now that you have StorageManager.js installed, head over to the Quick Start guide to learn how to use it.